Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
3b252796
Kaydet (Commit)
3b252796
authored
May 14, 2013
tarafından
Andre Fischer
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
122302: Use tool bar controls for color controls in text property panel.
üst
de52e4d0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
549 additions
and
121 deletions
+549
-121
Library_sfx.mk
sfx2/Library_sfx.mk
+1
-0
Package_inc.mk
sfx2/Package_inc.mk
+9
-8
ControlFactory.hxx
sfx2/inc/sfx2/sidebar/ControlFactory.hxx
+16
-3
ControllerFactory.hxx
sfx2/inc/sfx2/sidebar/ControllerFactory.hxx
+15
-23
EnumContext.hxx
sfx2/inc/sfx2/sidebar/EnumContext.hxx
+3
-0
SidebarToolBox.hxx
sfx2/inc/sfx2/sidebar/SidebarToolBox.hxx
+105
-0
ControlFactory.cxx
sfx2/source/sidebar/ControlFactory.cxx
+19
-3
ControllerFactory.cxx
sfx2/source/sidebar/ControllerFactory.cxx
+108
-0
EnumContext.cxx
sfx2/source/sidebar/EnumContext.cxx
+33
-17
SidebarController.cxx
sfx2/source/sidebar/SidebarController.cxx
+10
-4
SidebarController.hxx
sfx2/source/sidebar/SidebarController.hxx
+4
-2
SidebarToolBox.cxx
sfx2/source/sidebar/SidebarToolBox.cxx
+195
-2
ToolBoxBackground.cxx
sfx2/source/sidebar/ToolBoxBackground.cxx
+0
-4
PanelFactory.cxx
svx/source/sidebar/PanelFactory.cxx
+4
-1
InsertPropertyPanel.cxx
svx/source/sidebar/insert/InsertPropertyPanel.cxx
+0
-0
InsertPropertyPanel.hxx
svx/source/sidebar/insert/InsertPropertyPanel.hxx
+0
-32
TextPropertyPanel.cxx
svx/source/sidebar/text/TextPropertyPanel.cxx
+0
-0
TextPropertyPanel.hrc
svx/source/sidebar/text/TextPropertyPanel.hrc
+2
-2
TextPropertyPanel.hxx
svx/source/sidebar/text/TextPropertyPanel.hxx
+6
-18
TextPropertyPanel.src
svx/source/sidebar/text/TextPropertyPanel.src
+19
-2
No files found.
sfx2/Library_sfx.mk
Dosyayı görüntüle @
3b252796
...
...
@@ -224,6 +224,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/sidebar/ContextChangeBroadcaster \
sfx2/source/sidebar/ContextList \
sfx2/source/sidebar/ControlFactory \
sfx2/source/sidebar/ControllerFactory \
sfx2/source/sidebar/ControllerItem \
sfx2/source/sidebar/CustomImageRadioButton \
sfx2/source/sidebar/Deck \
...
...
sfx2/Package_inc.mk
Dosyayı görüntüle @
3b252796
...
...
@@ -131,15 +131,16 @@ $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/userinputinterception.hxx,sf
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/viewfac.hxx,sfx2/viewfac.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/viewfrm.hxx,sfx2/viewfrm.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/viewsh.hxx,sfx2/viewsh.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/SidebarChildWindow.hxx,sfx2/sidebar/SidebarChildWindow.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/SidebarPanelBase.hxx,sfx2/sidebar/SidebarPanelBase.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/CommandInfoProvider.hxx,sfx2/sidebar/CommandInfoProvider.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/ControlFactory.hxx,sfx2/sidebar/ControlFactory.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/ControllerFactory.hxx,sfx2/sidebar/ControllerFactory.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/ControllerItem.hxx,sfx2/sidebar/ControllerItem.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/ResourceDefinitions.hrc,sfx2/sidebar/ResourceDefinitions.hrc))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/EnumContext.hxx,sfx2/sidebar/EnumContext.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/ControlFactory.hxx,sfx2/sidebar/ControlFactory.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/Theme.hxx,sfx2/sidebar/Theme.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/ILayoutableWindow.hxx,sfx2/sidebar/ILayoutableWindow.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/IContextChangeReceiver.hxx,sfx2/sidebar/IContextChangeReceiver.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/ILayoutableWindow.hxx,sfx2/sidebar/ILayoutableWindow.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/ResourceDefinitions.hrc,sfx2/sidebar/ResourceDefinitions.hrc))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/SidebarChildWindow.hxx,sfx2/sidebar/SidebarChildWindow.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/SidebarPanelBase.hxx,sfx2/sidebar/SidebarPanelBase.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/SidebarToolBox.hxx,sfx2/sidebar/SidebarToolBox.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/Theme.hxx,sfx2/sidebar/Theme.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/Tools.hxx,sfx2/sidebar/Tools.hxx))
$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/CommandInfoProvider.hxx,sfx2/sidebar/CommandInfoProvider.hxx))
sfx2/inc/sfx2/sidebar/ControlFactory.hxx
Dosyayı görüntüle @
3b252796
...
...
@@ -23,21 +23,34 @@
#define SFX_SIDEBAR_CONTROL_FACTORY_HXX
#include <sfx2/dllapi.h>
#include <sfx2/sidebar/SidebarToolBox.hxx>
#include <vcl/button.hxx>
#include <com/sun/star/frame/XFrame.hpp>
class
ToolBox
;
namespace
sfx2
{
namespace
sidebar
{
class
ToolBoxBackground
;
class
SFX2_DLLPUBLIC
ControlFactory
{
public
:
static
CheckBox
*
CreateMenuButton
(
Window
*
pParentWindow
);
static
ImageRadioButton
*
CreateTabItem
(
Window
*
pParentWindow
);
static
ToolBox
*
CreateToolBox
(
Window
*
pParentWindow
,
const
ResId
&
rResId
);
/** Create a tool box that does *not* handle its items.
*/
static
SidebarToolBox
*
CreateToolBox
(
Window
*
pParentWindow
,
const
ResId
&
rResId
);
/** Create a tool box that *does* handle its items.
*/
static
SidebarToolBox
*
CreateToolBox
(
Window
*
pParentWindow
,
const
ResId
&
rResId
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
frame
::
XFrame
>&
rxFrame
);
static
Window
*
CreateToolBoxBackground
(
Window
*
pParentWindow
);
static
ImageRadioButton
*
CreateCustomImageRadionButton
(
Window
*
pParentWindow
,
...
...
sfx2/
source/sidebar/SidebarToolBox
.hxx
→
sfx2/
inc/sfx2/sidebar/ControllerFactory
.hxx
Dosyayı görüntüle @
3b252796
...
...
@@ -19,36 +19,28 @@
*
*************************************************************/
#ifndef SFX_SIDEBAR_
TOOLBOX
_HXX
#define SFX_SIDEBAR_
TOOLBOX
_HXX
#ifndef SFX_SIDEBAR_
CONTROLLER_FACTORY
_HXX
#define SFX_SIDEBAR_
CONTROLLER_FACTORY
_HXX
#include "vcl/toolbox.hxx"
#include "sfx2/dllapi.h"
#include <com/sun/star/frame/XToolbarController.hpp>
#include <com/sun/star/frame/XFrame.hpp>
namespace
css
=
::
com
::
sun
::
star
;
namespace
cssu
=
::
com
::
sun
::
star
::
uno
;
namespace
sfx2
{
namespace
sidebar
{
class
SidebarToolBox
:
public
ToolBox
/** Convenience class for easy creation of toolbox controllers.
*/
class
SFX2_DLLPUBLIC
ControllerFactory
{
public
:
SidebarToolBox
(
Window
*
pParentWindow
,
const
ResId
&
rResId
);
virtual
~
SidebarToolBox
(
void
);
void
SetBorderWindow
(
const
Window
*
pBorderWindow
);
virtual
void
Paint
(
const
Rectangle
&
rRect
);
virtual
Point
GetPosPixel
(
void
)
const
;
virtual
void
SetPosSizePixel
(
long
nX
,
long
nY
,
long
nWidth
,
long
nHeight
,
sal_uInt16
nFlags
);
virtual
long
Notify
(
NotifyEvent
&
rEvent
);
private
:
bool
mbParentIsBorder
;
Image
maItemSeparator
;
static
cssu
::
Reference
<
css
::
frame
::
XToolbarController
>
CreateToolBoxController
(
ToolBox
*
pToolBox
,
const
sal_uInt16
nItemId
,
const
::
rtl
::
OUString
&
rsCommandName
,
const
cssu
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
};
...
...
sfx2/inc/sfx2/sidebar/EnumContext.hxx
Dosyayı görüntüle @
3b252796
...
...
@@ -129,6 +129,9 @@ public:
sal_Int32
GetCombinedContext_DI
(
void
)
const
;
const
::
rtl
::
OUString
&
GetApplicationName
(
void
)
const
;
Application
GetApplication
(
void
)
const
;
Application
GetApplication_DI
(
void
)
const
;
const
::
rtl
::
OUString
&
GetContextName
(
void
)
const
;
bool
operator
==
(
const
EnumContext
aOther
);
...
...
sfx2/inc/sfx2/sidebar/SidebarToolBox.hxx
0 → 100644
Dosyayı görüntüle @
3b252796
/**************************************************************
*
* 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
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
#ifndef SFX_SIDEBAR_TOOLBOX_HXX
#define SFX_SIDEBAR_TOOLBOX_HXX
#include "sfx2/dllapi.h"
#include "vcl/toolbox.hxx"
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/frame/XToolbarController.hpp>
#include <com/sun/star/util/URL.hpp>
#include <map>
namespace
css
=
::
com
::
sun
::
star
;
namespace
cssu
=
::
com
::
sun
::
star
::
uno
;
namespace
sfx2
{
namespace
sidebar
{
/** The sidebar tool box has two responsibilities:
1. Coordinated location, size, and other states with its parent
background window.
2. Create and handle tool bar controller for its items.
*/
class
SFX2_DLLPUBLIC
SidebarToolBox
:
public
ToolBox
{
public
:
/** Create a new tool box.
When a valid XFrame is given then the tool box will handle its
buttons and drop-downs. Otherwise the caller has to do that.
*/
SidebarToolBox
(
Window
*
pParentWindow
,
const
ResId
&
rResId
,
const
cssu
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
virtual
~
SidebarToolBox
(
void
);
void
SetBorderWindow
(
const
Window
*
pBorderWindow
);
virtual
void
Paint
(
const
Rectangle
&
rRect
);
virtual
Point
GetPosPixel
(
void
)
const
;
virtual
void
SetPosSizePixel
(
long
nX
,
long
nY
,
long
nWidth
,
long
nHeight
,
sal_uInt16
nFlags
);
virtual
long
Notify
(
NotifyEvent
&
rEvent
);
cssu
::
Reference
<
css
::
frame
::
XToolbarController
>
GetControllerForItemId
(
const
sal_uInt16
nItemId
)
const
;
sal_uInt16
GetItemIdForSubToolbarName
(
const
::
rtl
::
OUString
&
rsCOmmandName
)
const
;
private
:
bool
mbParentIsBorder
;
Image
maItemSeparator
;
class
ItemDescriptor
{
public
:
cssu
::
Reference
<
css
::
frame
::
XToolbarController
>
mxController
;
css
::
util
::
URL
maURL
;
rtl
::
OUString
msCurrentCommand
;
cssu
::
Reference
<
css
::
frame
::
XDispatch
>
mxDispatch
;
};
typedef
::
std
::
map
<
sal_uInt16
,
ItemDescriptor
>
ControllerContainer
;
ControllerContainer
maControllers
;
DECL_LINK
(
DropDownClickHandler
,
ToolBox
*
);
DECL_LINK
(
ClickHandler
,
ToolBox
*
);
DECL_LINK
(
DoubleClickHandler
,
ToolBox
*
);
DECL_LINK
(
SelectHandler
,
ToolBox
*
);
DECL_LINK
(
Activate
,
ToolBox
*
);
DECL_LINK
(
Deactivate
,
ToolBox
*
);
void
CreateController
(
const
sal_uInt16
nItemId
,
const
cssu
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
void
UpdateIcons
(
const
cssu
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
};
}
}
// end of namespace sfx2::sidebar
#endif
sfx2/source/sidebar/ControlFactory.cxx
Dosyayı görüntüle @
3b252796
...
...
@@ -25,7 +25,7 @@
#include "MenuButton.hxx"
#include "TabItem.hxx"
#include "SidebarToolBox.hxx"
#include "
sfx2/sidebar/
SidebarToolBox.hxx"
#include "ToolBoxBackground.hxx"
#include "CustomImageRadioButton.hxx"
#include <vcl/toolbox.hxx>
...
...
@@ -50,11 +50,27 @@ ImageRadioButton* ControlFactory::CreateTabItem (Window* pParentWindow)
ToolBox
*
ControlFactory
::
CreateToolBox
(
Sidebar
ToolBox
*
ControlFactory
::
CreateToolBox
(
Window
*
pParentWindow
,
const
ResId
&
rResId
)
{
SidebarToolBox
*
pToolBox
=
new
SidebarToolBox
(
pParentWindow
,
rResId
);
SidebarToolBox
*
pToolBox
=
new
SidebarToolBox
(
pParentWindow
,
rResId
,
NULL
);
pToolBox
->
SetBorderWindow
(
pParentWindow
);
pToolBox
->
Invalidate
();
return
pToolBox
;
}
SidebarToolBox
*
ControlFactory
::
CreateToolBox
(
Window
*
pParentWindow
,
const
ResId
&
rResId
,
const
cssu
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
)
{
SidebarToolBox
*
pToolBox
=
new
SidebarToolBox
(
pParentWindow
,
rResId
,
rxFrame
);
pToolBox
->
SetBorderWindow
(
pParentWindow
);
pToolBox
->
Invalidate
();
...
...
sfx2/source/sidebar/ControllerFactory.cxx
0 → 100644
Dosyayı görüntüle @
3b252796
/**************************************************************
*
* 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
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*************************************************************/
#include "precompiled_sfx2.hxx"
#include "sfx2/sidebar/ControllerFactory.hxx"
#include "sfx2/sidebar/CommandInfoProvider.hxx"
#include "sfx2/sidebar/Tools.hxx"
#include <com/sun/star/frame/XToolbarController.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <framework/sfxhelperfunctions.hxx>
#include <svtools/generictoolboxcontroller.hxx>
#include <comphelper/processfactory.hxx>
using
namespace
css
;
using
namespace
cssu
;
using
::
rtl
::
OUString
;
namespace
sfx2
{
namespace
sidebar
{
Reference
<
frame
::
XToolbarController
>
ControllerFactory
::
CreateToolBoxController
(
ToolBox
*
pToolBox
,
const
sal_uInt16
nItemId
,
const
OUString
&
rsCommandName
,
const
Reference
<
frame
::
XFrame
>&
rxFrame
)
{
// Create a controller for the new item.
Reference
<
frame
::
XToolbarController
>
xController
(
static_cast
<
XWeak
*>
(
::
framework
::
CreateToolBoxController
(
rxFrame
,
pToolBox
,
nItemId
,
rsCommandName
)),
UNO_QUERY
);
if
(
!
xController
.
is
())
xController
.
set
(
static_cast
<
XWeak
*>
(
new
svt
::
GenericToolboxController
(
::
comphelper
::
getProcessServiceFactory
(),
rxFrame
,
pToolBox
,
nItemId
,
rsCommandName
)),
UNO_QUERY
);
// Initialize the controller with eg a service factory.
Reference
<
lang
::
XInitialization
>
xInitialization
(
xController
,
UNO_QUERY
);
if
(
xInitialization
.
is
())
{
beans
::
PropertyValue
aPropValue
;
std
::
vector
<
Any
>
aPropertyVector
;
aPropValue
.
Name
=
A2S
(
"Frame"
);
aPropValue
.
Value
<<=
rxFrame
;
aPropertyVector
.
push_back
(
makeAny
(
aPropValue
));
aPropValue
.
Name
=
A2S
(
"ServiceManager"
);
aPropValue
.
Value
<<=
::
comphelper
::
getProcessServiceFactory
();
aPropertyVector
.
push_back
(
makeAny
(
aPropValue
));
aPropValue
.
Name
=
A2S
(
"CommandURL"
);
aPropValue
.
Value
<<=
rsCommandName
;
aPropertyVector
.
push_back
(
makeAny
(
aPropValue
));
Sequence
<
Any
>
aArgs
(
comphelper
::
containerToSequence
(
aPropertyVector
));
xInitialization
->
initialize
(
aArgs
);
}
Reference
<
util
::
XUpdatable
>
xUpdatable
(
xController
,
UNO_QUERY
);
if
(
xUpdatable
.
is
())
xUpdatable
->
update
();
// Add label.
if
(
xController
.
is
())
{
const
OUString
sLabel
(
sfx2
::
sidebar
::
CommandInfoProvider
::
Instance
().
GetLabelForCommand
(
rsCommandName
,
rxFrame
));
pToolBox
->
SetQuickHelpText
(
nItemId
,
sLabel
);
pToolBox
->
EnableItem
(
nItemId
);
}
return
xController
;
}
}
}
// end of namespace sfx2::sidebar
sfx2/source/sidebar/EnumContext.cxx
Dosyayı görüntüle @
3b252796
...
...
@@ -88,23 +88,39 @@ sal_Int32 EnumContext::GetCombinedContext (void) const
sal_Int32
EnumContext
::
GetCombinedContext_DI
(
void
)
const
{
switch
(
meApplication
)
{
case
Application_Draw
:
case
Application_Impress
:
return
CombinedEnumContext
(
Application_DrawImpress
,
meContext
);
case
Application_Writer
:
case
Application_WriterGlobal
:
case
Application_WriterWeb
:
case
Application_WriterXML
:
case
Application_WriterForm
:
case
Application_WriterReport
:
return
CombinedEnumContext
(
Application_WriterVariants
,
meContext
);
default
:
return
CombinedEnumContext
(
meApplication
,
meContext
);
}
return
CombinedEnumContext
(
GetApplication_DI
(),
meContext
);
}
EnumContext
::
Application
EnumContext
::
GetApplication_DI
(
void
)
const
{
switch
(
meApplication
)
{
case
Application_Draw
:
case
Application_Impress
:
return
Application_DrawImpress
;
case
Application_Writer
:
case
Application_WriterGlobal
:
case
Application_WriterWeb
:
case
Application_WriterXML
:
case
Application_WriterForm
:
case
Application_WriterReport
:
return
Application_WriterVariants
;
default
:
return
meApplication
;
}
}
EnumContext
::
Application
EnumContext
::
GetApplication
(
void
)
const
{
return
meApplication
;
}
...
...
sfx2/source/sidebar/SidebarController.cxx
Dosyayı görüntüle @
3b252796
...
...
@@ -580,7 +580,8 @@ void SidebarController::SwitchToDeck (
aNewPanels
[
nWriteIndex
]
=
CreatePanel
(
rPanelContexDescriptor
.
msId
,
mpCurrentDeck
->
GetPanelParentWindow
(),
rPanelContexDescriptor
.
mbIsInitiallyVisible
);
rPanelContexDescriptor
.
mbIsInitiallyVisible
,
rContext
);
bHasPanelSetChanged
=
true
;
}
if
(
aNewPanels
[
nWriteIndex
]
!=
NULL
)
...
...
@@ -649,7 +650,8 @@ bool SidebarController::ArePanelSetsEqual (
SharedPanel
SidebarController
::
CreatePanel
(
const
OUString
&
rsPanelId
,
::
Window
*
pParentWindow
,
const
bool
bIsInitiallyExpanded
)
const
bool
bIsInitiallyExpanded
,
const
Context
&
rContext
)
{
const
PanelDescriptor
*
pPanelDescriptor
=
ResourceManager
::
Instance
().
GetPanelDescriptor
(
rsPanelId
);
if
(
pPanelDescriptor
==
NULL
)
...
...
@@ -667,7 +669,8 @@ SharedPanel SidebarController::CreatePanel (
Reference
<
ui
::
XUIElement
>
xUIElement
(
CreateUIElement
(
pPanel
->
GetComponentInterface
(),
pPanelDescriptor
->
msImplementationURL
,
pPanelDescriptor
->
mbWantsCanvas
));
pPanelDescriptor
->
mbWantsCanvas
,
rContext
));
if
(
xUIElement
.
is
())
{
// Initialize the panel and add it to the active deck.
...
...
@@ -687,7 +690,8 @@ SharedPanel SidebarController::CreatePanel (
Reference
<
ui
::
XUIElement
>
SidebarController
::
CreateUIElement
(
const
Reference
<
awt
::
XWindowPeer
>&
rxWindow
,
const
::
rtl
::
OUString
&
rsImplementationURL
,
const
bool
bWantsCanvas
)
const
bool
bWantsCanvas
,
const
Context
&
rContext
)
{
try
{
...
...
@@ -710,6 +714,8 @@ Reference<ui::XUIElement> SidebarController::CreateUIElement (
Reference
<
rendering
::
XSpriteCanvas
>
xCanvas
(
VCLUnoHelper
::
GetWindow
(
rxWindow
)
->
GetSpriteCanvas
());
aCreationArguments
.
put
(
"Canvas"
,
makeAny
(
xCanvas
));
}
aCreationArguments
.
put
(
"ApplicationName"
,
makeAny
(
rContext
.
msApplication
));
aCreationArguments
.
put
(
"ContextName"
,
makeAny
(
rContext
.
msContext
));
Reference
<
ui
::
XUIElement
>
xUIElement
(
xUIElementFactory
->
createUIElement
(
...
...
sfx2/source/sidebar/SidebarController.hxx
Dosyayı görüntüle @
3b252796
...
...
@@ -169,11 +169,13 @@ private:
cssu
::
Reference
<
css
::
ui
::
XUIElement
>
CreateUIElement
(
const
cssu
::
Reference
<
css
::
awt
::
XWindowPeer
>&
rxWindow
,
const
::
rtl
::
OUString
&
rsImplementationURL
,
const
bool
bWantsCanvas
);
const
bool
bWantsCanvas
,
const
Context
&
rContext
);
SharedPanel
CreatePanel
(
const
::
rtl
::
OUString
&
rsPanelId
,
::
Window
*
pParentWindow
,
const
bool
bIsInitiallyExpanded
);
const
bool
bIsInitiallyExpanded
,
const
Context
&
rContext
);
void
SwitchToDeck
(
const
DeckDescriptor
&
rDeckDescriptor
,
const
Context
&
rContext
);
...
...
sfx2/source/sidebar/SidebarToolBox.cxx
Dosyayı görüntüle @
3b252796
...
...
@@ -21,8 +21,9 @@
#include "precompiled_sfx2.hxx"
#include "SidebarToolBox.hxx"
#include "
sfx2/sidebar/
SidebarToolBox.hxx"
#include "ToolBoxBackground.hxx"
#include "sfx2/sidebar/ControllerFactory.hxx"
#include "sfx2/sidebar/Theme.hxx"
#include "sfx2/sidebar/Tools.hxx"
...
...
@@ -31,6 +32,7 @@
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
::
rtl
::
OUString
;
namespace
sfx2
{
namespace
sidebar
{
...
...
@@ -38,13 +40,32 @@ namespace sfx2 { namespace sidebar {
SidebarToolBox
::
SidebarToolBox
(
Window
*
pParentWindow
,
const
ResId
&
rResId
)
const
ResId
&
rResId
,
const
cssu
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
)
:
ToolBox
(
pParentWindow
,
rResId
),
mbParentIsBorder
(
false
),
maItemSeparator
(
Theme
::
GetImage
(
Theme
::
Image_ToolBoxItemSeparator
))
{
SetBackground
(
Wallpaper
());
SetPaintTransparent
(
true
);
if
(
rxFrame
.
is
())
{
const
sal_uInt16
nItemCount
(
GetItemCount
());
for
(
sal_uInt16
nItemIndex
=
0
;
nItemIndex
<
nItemCount
;
++
nItemIndex
)
CreateController
(
GetItemId
(
nItemIndex
),
rxFrame
);
UpdateIcons
(
rxFrame
);
SetSizePixel
(
CalcWindowSizePixel
());
SetDropdownClickHdl
(
LINK
(
this
,
SidebarToolBox
,
DropDownClickHandler
));
SetClickHdl
(
LINK
(
this
,
SidebarToolBox
,
ClickHandler
));
SetDoubleClickHdl
(
LINK
(
this
,
SidebarToolBox
,
DoubleClickHandler
));
SetSelectHdl
(
LINK
(
this
,
SidebarToolBox
,
SelectHandler
));
SetActivateHdl
(
LINK
(
this
,
SidebarToolBox
,
Activate
));
SetDeactivateHdl
(
LINK
(
this
,
SidebarToolBox
,
Deactivate
));
}
#ifdef DEBUG
SetText
(
A2S
(
"SidebarToolBox"
));
#endif
...
...
@@ -55,6 +76,24 @@ SidebarToolBox::SidebarToolBox (
SidebarToolBox
::~
SidebarToolBox
(
void
)
{
ControllerContainer
aControllers
;
aControllers
.
swap
(
maControllers
);
for
(
ControllerContainer
::
iterator
iController
(
aControllers
.
begin
()),
iEnd
(
aControllers
.
end
());
iController
!=
iEnd
;
++
iController
)
{
Reference
<
lang
::
XComponent
>
xComponent
(
iController
->
second
.
mxController
,
UNO_QUERY
);
if
(
xComponent
.
is
())
xComponent
->
dispose
();
}
SetDropdownClickHdl
(
Link
());
SetClickHdl
(
Link
());
SetDoubleClickHdl
(
Link
());
SetSelectHdl
(
Link
());
SetActivateHdl
(
Link
());
SetDeactivateHdl
(
Link
());
}
...
...
@@ -173,4 +212,158 @@ long SidebarToolBox::Notify (NotifyEvent& rEvent)
}
void
SidebarToolBox
::
CreateController
(
const
sal_uInt16
nItemId
,
const
cssu
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
)
{
ItemDescriptor
aDescriptor
;
const
OUString
sCommandName
(
GetItemCommand
(
nItemId
));
aDescriptor
.
mxController
=
sfx2
::
sidebar
::
ControllerFactory
::
CreateToolBoxController
(
this
,
nItemId
,
sCommandName
,
rxFrame
);
aDescriptor
.
maURL
=
sfx2
::
sidebar
::
Tools
::
GetURL
(
sCommandName
);
aDescriptor
.
msCurrentCommand
=
sCommandName
;
aDescriptor
.
mxDispatch
=
sfx2
::
sidebar
::
Tools
::
GetDispatch
(
rxFrame
,
aDescriptor
.
maURL
);
if
(
aDescriptor
.
mxController
.
is
()
&&
aDescriptor
.
mxDispatch
.
is
())
maControllers
.
insert
(
::
std
::
make_pair
(
nItemId
,
aDescriptor
));
}
Reference
<
frame
::
XToolbarController
>
SidebarToolBox
::
GetControllerForItemId
(
const
sal_uInt16
nItemId
)
const
{
ControllerContainer
::
const_iterator
iController
(
maControllers
.
find
(
nItemId
));
if
(
iController
!=
maControllers
.
end
())
return
iController
->
second
.
mxController
;
else
return
NULL
;
}
void
SidebarToolBox
::
UpdateIcons
(
const
Reference
<
frame
::
XFrame
>&
rxFrame
)
{
const
sal_Bool
bBigImages
(
SvtMiscOptions
().
AreCurrentSymbolsLarge
());
const
bool
bIsHighContrastActive
(
sfx2
::
sidebar
::
Theme
::
IsHighContrastMode
());
for
(
ControllerContainer
::
iterator
iController
(
maControllers
.
begin
()),
iEnd
(
maControllers
.
end
());
iController
!=
iEnd
;
++
iController
)
{
const
::
rtl
::
OUString
sCommandURL
(
iController
->
second
.
msCurrentCommand
);
Image
aImage
(
framework
::
GetImageFromURL
(
rxFrame
,
sCommandURL
,
bBigImages
,
bIsHighContrastActive
));
SetItemImage
(
iController
->
first
,
aImage
);
}
}
sal_uInt16
SidebarToolBox
::
GetItemIdForSubToolbarName
(
const
OUString
&
rsSubToolbarName
)
const
{
for
(
ControllerContainer
::
const_iterator
iController
(
maControllers
.
begin
()),
iEnd
(
maControllers
.
end
());
iController
!=
iEnd
;
++
iController
)
{
Reference
<
frame
::
XToolbarController
>
xController
(
iController
->
second
.
mxController
);
Reference
<
frame
::
XSubToolbarController
>
xSubToolbarController
(
xController
,
UNO_QUERY
);
if
(
xSubToolbarController
.
is
())
{
const
OUString
sName
(
xSubToolbarController
->
getSubToolbarName
());
if
(
sName
.
equals
(
rsSubToolbarName
))
return
iController
->
first
;
}
}
return
0
;
}
IMPL_LINK
(
SidebarToolBox
,
DropDownClickHandler
,
ToolBox
*
,
pToolBox
)
{
if
(
pToolBox
!=
NULL
)
{
Reference
<
frame
::
XToolbarController
>
xController
(
GetControllerForItemId
(
pToolBox
->
GetCurItemId
()));
if
(
xController
.
is
())
{
Reference
<
awt
::
XWindow
>
xWindow
=
xController
->
createPopupWindow
();
if
(
xWindow
.
is
()
)
xWindow
->
setFocus
();
}
}
return
1
;
}
IMPL_LINK
(
SidebarToolBox
,
ClickHandler
,
ToolBox
*
,
pToolBox
)
{
if
(
pToolBox
==
NULL
)
return
0
;
Reference
<
frame
::
XToolbarController
>
xController
(
GetControllerForItemId
(
pToolBox
->
GetCurItemId
()));
if
(
xController
.
is
())
xController
->
click
();
return
1
;
}
IMPL_LINK
(
SidebarToolBox
,
DoubleClickHandler
,
ToolBox
*
,
pToolBox
)
{
if
(
pToolBox
==
NULL
)
return
0
;
Reference
<
frame
::
XToolbarController
>
xController
(
GetControllerForItemId
(
pToolBox
->
GetCurItemId
()));
if
(
xController
.
is
())
xController
->
doubleClick
();
return
1
;
}
IMPL_LINK
(
SidebarToolBox
,
SelectHandler
,
ToolBox
*
,
pToolBox
)
{
if
(
pToolBox
==
NULL
)
return
0
;
Reference
<
frame
::
XToolbarController
>
xController
(
GetControllerForItemId
(
pToolBox
->
GetCurItemId
()));
if
(
xController
.
is
())
xController
->
execute
((
sal_Int16
)
pToolBox
->
GetModifier
());
return
1
;
}
IMPL_LINK
(
SidebarToolBox
,
Activate
,
ToolBox
*
,
EMPTYARG
)
{
return
1
;
}
IMPL_LINK
(
SidebarToolBox
,
Deactivate
,
ToolBox
*
,
EMPTYARG
)
{
return
1
;
}
}
}
// end of namespace sfx2::sidebar
sfx2/source/sidebar/ToolBoxBackground.cxx
Dosyayı görüntüle @
3b252796
...
...
@@ -138,10 +138,6 @@ IMPL_LINK(ToolBoxBackground, WindowEventHandler, VclWindowEvent*, pEvent)
Hide
();
break
;
case
SFX_HINT_DYING
:
doLazyDelete
();
break
;
default
:
break
;
}
...
...
svx/source/sidebar/PanelFactory.cxx
Dosyayı görüntüle @
3b252796
...
...
@@ -118,6 +118,9 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
Reference
<
ui
::
XSidebar
>
xSidebar
(
aArguments
.
getOrDefault
(
"Sidebar"
,
Reference
<
ui
::
XSidebar
>
()));
const
sal_uInt64
nBindingsValue
(
aArguments
.
getOrDefault
(
"SfxBindings"
,
sal_uInt64
(
0
)));
SfxBindings
*
pBindings
=
reinterpret_cast
<
SfxBindings
*>
(
nBindingsValue
);
::
sfx2
::
sidebar
::
EnumContext
aContext
(
aArguments
.
getOrDefault
(
"ApplicationName"
,
OUString
()),
aArguments
.
getOrDefault
(
"ContextName"
,
OUString
()));
::
Window
*
pParentWindow
=
VCLUnoHelper
::
GetWindow
(
xParentWindow
);
if
(
!
xParentWindow
.
is
()
||
pParentWindow
==
NULL
)
...
...
@@ -139,7 +142,7 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
#define DoesResourceEndWith(s) rsResourceURL.endsWithAsciiL(s,strlen(s))
if
(
DoesResourceEndWith
(
"/TextPropertyPanel"
))
{
pControl
=
TextPropertyPanel
::
Create
(
pParentWindow
,
xFrame
,
pBindings
);
pControl
=
TextPropertyPanel
::
Create
(
pParentWindow
,
xFrame
,
pBindings
,
aContext
);
}
else
if
(
DoesResourceEndWith
(
"/ParaPropertyPanel"
))
{
...
...
svx/source/sidebar/insert/InsertPropertyPanel.cxx
Dosyayı görüntüle @
3b252796
This diff is collapsed.
Click to expand it.
svx/source/sidebar/insert/InsertPropertyPanel.hxx
Dosyayı görüntüle @
3b252796
...
...
@@ -53,41 +53,9 @@ private:
::
boost
::
scoped_ptr
<
ToolBox
>
mpStandardShapesToolBox
;
::
boost
::
scoped_ptr
<
Window
>
mpCustomShapesBackground
;
::
boost
::
scoped_ptr
<
ToolBox
>
mpCustomShapesToolBox
;
class
ItemDescriptor
{
public
:
cssu
::
Reference
<
css
::
frame
::
XToolbarController
>
mxController
;
css
::
util
::
URL
maURL
;
rtl
::
OUString
msCurrentCommand
;
cssu
::
Reference
<
css
::
frame
::
XDispatch
>
mxDispatch
;
};
typedef
::
std
::
map
<
sal_uInt16
,
ItemDescriptor
>
ControllerContainer
;
ControllerContainer
maControllers
;
const
cssu
::
Reference
<
css
::
frame
::
XFrame
>
mxFrame
;
/** Add listeners to toolbox and update its size to match its
content.
*/
void
SetupToolBox
(
ToolBox
&
rToolBox
);
cssu
::
Reference
<
css
::
frame
::
XToolbarController
>
GetControllerForItemId
(
const
sal_uInt16
nItemId
)
const
;
ToolBox
*
GetToolBoxForItemId
(
const
sal_uInt16
nItemId
)
const
;
sal_uInt16
GetItemIdForSubToolbarName
(
const
::
rtl
::
OUString
&
rsCOmmandName
)
const
;
/** Create toolbox controller for one item.
*/
void
CreateController
(
const
sal_uInt16
nItemId
);
void
UpdateIcons
(
void
);
DECL_LINK
(
DropDownClickHandler
,
ToolBox
*
);
DECL_LINK
(
ClickHandler
,
ToolBox
*
);
DECL_LINK
(
DoubleClickHandler
,
ToolBox
*
);
DECL_LINK
(
SelectHandler
,
ToolBox
*
);
DECL_LINK
(
WindowEventListener
,
VclSimpleEvent
*
);
DECL_LINK
(
Activate
,
ToolBox
*
);
DECL_LINK
(
Deactivate
,
ToolBox
*
);
};
...
...
svx/source/sidebar/text/TextPropertyPanel.cxx
Dosyayı görüntüle @
3b252796
This diff is collapsed.
Click to expand it.
svx/source/sidebar/text/TextPropertyPanel.hrc
Dosyayı görüntüle @
3b252796
...
...
@@ -34,11 +34,11 @@
#define TB_FONT 4
#define TB_INCREASE_DECREASE 5
#define TB_FONTCOLOR 6
#define TB_
SCRIPT_SW
7
#define TB_
FONTCOLOR_SW
7
#define TB_HIGHLIGHT 8
#define TB_SPACING 9
#define TB_SCRIPT 10
#define TB_SCRIPT_SW 11
#define TBI_FONTCOLOR 50
#define TBI_BOLD 51
...
...
svx/source/sidebar/text/TextPropertyPanel.hxx
Dosyayı görüntüle @
3b252796
...
...
@@ -26,6 +26,7 @@
#include <sfx2/sidebar/SidebarPanelBase.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
#include <sfx2/sidebar/EnumContext.hxx>
#include <svtools/ctrlbox.hxx>
#include <svx/tbxcolorupdate.hxx>
...
...
@@ -33,6 +34,7 @@
#include <editeng/fhgtitem.hxx>
#include <com/sun/star/ui/XSidebar.hpp>
#include <com/sun/star/frame/XToolbarController.hpp>
#include <boost/scoped_ptr.hpp>
#include "TextCharacterSpacingPopup.hxx"
...
...
@@ -58,7 +60,8 @@ public:
static
TextPropertyPanel
*
Create
(
Window
*
pParent
,
const
cssu
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
,
SfxBindings
*
pBindings
);
SfxBindings
*
pBindings
,
const
::
sfx2
::
sidebar
::
EnumContext
&
rContext
);
virtual
void
DataChanged
(
const
DataChangedEvent
&
rEvent
);
...
...
@@ -67,8 +70,6 @@ public:
void
SetSpacing
(
long
nKern
);
void
EndSpacingPopupMode
(
void
);
void
EndUnderlinePopupMode
(
void
);
void
SetFontColor
(
const
String
&
rsColorName
,
const
Color
aColor
);
void
SetBrushColor
(
const
String
&
rsColorName
,
const
Color
aColor
);
void
SetUnderline
(
FontUnderline
eUnderline
);
Color
&
GetUnderlineColor
();
void
SetDefaultUnderline
(
FontUnderline
eUnderline
);
...
...
@@ -113,12 +114,10 @@ private:
::
sfx2
::
sidebar
::
ControllerItem
maUnderlineControl
;
::
sfx2
::
sidebar
::
ControllerItem
maStrikeControl
;
::
sfx2
::
sidebar
::
ControllerItem
maShadowControl
;
::
sfx2
::
sidebar
::
ControllerItem
maFontColorControl
;
::
sfx2
::
sidebar
::
ControllerItem
maScriptControlSw
;
::
sfx2
::
sidebar
::
ControllerItem
maSuperScriptControl
;
::
sfx2
::
sidebar
::
ControllerItem
maSubScriptControl
;
::
sfx2
::
sidebar
::
ControllerItem
maSpacingControl
;
::
sfx2
::
sidebar
::
ControllerItem
maHighlightControl
;
::
sfx2
::
sidebar
::
ControllerItem
maSDFontGrow
;
::
sfx2
::
sidebar
::
ControllerItem
maSDFontShrink
;
...
...
@@ -130,10 +129,6 @@ private:
FontStrikeout
meStrike
;
bool
mbWeightAvailable
;
bool
mbPostureAvailable
;
Color
maColor
;
bool
mbColorAvailable
;
Color
maBackColor
;
bool
mbBackColorAvailable
;
SvxEscapement
meEscape
;
//for sw
bool
mbSuper
;
bool
mbSub
;
...
...
@@ -147,8 +142,6 @@ private:
bool
mbFocusOnFontSizeCtrl
;
TextCharacterSpacingPopup
maCharSpacePopup
;
TextUnderlinePopup
maUnderlinePopup
;
ColorPopup
maFontColorPopup
;
ColorPopup
maBrushColorPopup
;
cssu
::
Reference
<
css
::
frame
::
XFrame
>
mxFrame
;
::
sfx2
::
sidebar
::
EnumContext
maContext
;
...
...
@@ -157,26 +150,21 @@ private:
TextPropertyPanel
(
Window
*
pParent
,
const
cssu
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
,
SfxBindings
*
pBindings
);
SfxBindings
*
pBindings
,
const
::
sfx2
::
sidebar
::
EnumContext
&
rContext
);
virtual
~
TextPropertyPanel
(
void
);
PopupControl
*
CreateCharacterSpacingControl
(
PopupContainer
*
pParent
);
PopupControl
*
CreateFontColorPopupControl
(
PopupContainer
*
pParent
);
PopupControl
*
CreateBrushColorPopupControl
(
PopupContainer
*
pParent
);
PopupControl
*
CreateUnderlinePopupControl
(
PopupContainer
*
pParent
);
DECL_LINK
(
SpacingClickHdl
,
ToolBox
*
);
DECL_LINK
(
ToolBoxFontColorDropHdl
,
ToolBox
*
);
//for new color picker
DECL_LINK
(
ToolBoxHighlightDropHdl
,
ToolBox
*
);
DECL_LINK
(
ToolBoxUnderlineClickHdl
,
ToolBox
*
);
void
Initialize
(
void
);
void
SetupToolboxItems
(
void
);
void
InitToolBoxFont
();
void
InitToolBoxIncDec
();
void
InitToolBoxFontColor
();
void
InitToolBoxScript
();
void
InitToolBoxHighlight
();
void
InitToolBoxSpacing
();
DECL_LINK
(
FontSelHdl
,
FontNameBox
*
);
...
...
svx/source/sidebar/text/TextPropertyPanel.src
Dosyayı görüntüle @
3b252796
...
...
@@ -153,7 +153,6 @@ Control RID_SIDEBAR_TEXT_PANEL
Pos = MAP_APPFONT (X3, THIRD_LINE_Y) ;
Size = MAP_APPFONT (TOOLBOX_ITEM_DD_WIDTH ,TOOLBOX_ITEM_HEIGHT ) ;
TabStop = TRUE ;
Text = "Font Color" ;
ItemList =
{
ToolBoxItem
...
...
@@ -165,6 +164,24 @@ Control RID_SIDEBAR_TEXT_PANEL
};
};
};
ToolBox TB_FONTCOLOR_SW
{
HelpID = HID_PPROPERTYPANEL_TEXT_TBX_FONT_COLOR;
SVLook = TRUE ;
Pos = MAP_APPFONT (X3, THIRD_LINE_Y) ;
Size = MAP_APPFONT (TOOLBOX_ITEM_DD_WIDTH ,TOOLBOX_ITEM_HEIGHT ) ;
TabStop = TRUE ;
ItemList =
{
ToolBoxItem
{
Identifier = TBI_FONTCOLOR ;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_FONT_COLOR;
DropDown = TRUE ;
Command = ".uno:FontColor";
};
};
};
ToolBox TB_HIGHLIGHT
{
...
...
@@ -181,7 +198,7 @@ Control RID_SIDEBAR_TEXT_PANEL
Identifier = TBI_HIGHLIGHT ;
HelpID = HID_PPROPERTYPANEL_TEXT_TBI_HIGHLIGHT_COLOR;
DropDown = TRUE ;
Command = ".uno:
CharacterBackgroundPattern
";
Command = ".uno:
BackColor
";
};
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment