[PATCH] Sidebar conversion to .ui for sidebar_page_property
Prashant Pandey (via Code Review)
gerrit at gerrit.libreoffice.org
Sat Jun 15 16:45:03 PDT 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/4298
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/98/4298/1
Sidebar conversion to .ui for sidebar_page_property
Change-Id: I6ffc36fa8d3c6656392354864092f6cbc7e3c30d
---
M sw/UIConfig_swriter.mk
M sw/source/ui/sidebar/PagePropertyPanel.cxx
M sw/source/ui/sidebar/PagePropertyPanel.hrc
M sw/source/ui/sidebar/PagePropertyPanel.hxx
M sw/source/ui/sidebar/PagePropertyPanel.src
A sw/uiconfig/swriter/ui/sidebarpage.ui
6 files changed, 310 insertions(+), 231 deletions(-)
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index daf19a7..8e336c0 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -106,6 +106,7 @@
sw/uiconfig/swriter/ui/renameautotextdialog \
sw/uiconfig/swriter/ui/renameobjectdialog \
sw/uiconfig/swriter/ui/rowheight \
+ sw/uiconfig/swriter/ui/sidebarpage \
sw/uiconfig/swriter/ui/sortdialog \
sw/uiconfig/swriter/ui/splittable \
sw/uiconfig/swriter/ui/statisticsinfopage \
diff --git a/sw/source/ui/sidebar/PagePropertyPanel.cxx b/sw/source/ui/sidebar/PagePropertyPanel.cxx
index 8dc4d28..7780fe5 100644
--- a/sw/source/ui/sidebar/PagePropertyPanel.cxx
+++ b/sw/source/ui/sidebar/PagePropertyPanel.cxx
@@ -49,6 +49,11 @@
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/document/XUndoManagerSupplier.hpp>
+const char UNO_ORIENTATION[] = ".uno:Orientation";
+const char UNO_MARGIN[] = ".uno:Margin";
+const char UNO_SIZE[] = ".uno:Size";
+const char UNO_COLUMN[] = ".uno:Column";
+
#define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
namespace {
@@ -98,21 +103,9 @@
Window* pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
- : Control(pParent, SW_RES(RID_PROPERTYPANEL_SWPAGE))
+ : PanelLayout(pParent, "PagePropertyPanel", "modules/swriter/ui/sidebarpage.ui", rxFrame)
, mpBindings(pBindings)
- // visible controls
- , maFtOrientation( this, SW_RES(FT_ORIENTATION) )
- , mpToolBoxOrientationBackground( ::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
- , mpToolBoxOrientation( ::sfx2::sidebar::ControlFactory::CreateToolBox( mpToolBoxOrientationBackground.get(), SW_RES(TB_ORIENTATION)) )
- , maFtMargin( this, SW_RES(FT_MARGIN) )
- , mpToolBoxMarginBackground( ::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
- , mpToolBoxMargin( ::sfx2::sidebar::ControlFactory::CreateToolBox( mpToolBoxMarginBackground.get(), SW_RES(TB_MARGIN)) )
- , maFtSize( this, SW_RES(FT_SIZE) )
- , mpToolBoxSizeBackground( ::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
- , mpToolBoxSize( ::sfx2::sidebar::ControlFactory::CreateToolBox( mpToolBoxSizeBackground.get(), SW_RES(TB_SIZE)) )
- , maFtColumn( this, SW_RES(FT_COLUMN) )
- , mpToolBoxColumnBackground( ::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
- , mpToolBoxColumn( ::sfx2::sidebar::ControlFactory::CreateToolBox( mpToolBoxColumnBackground.get(), SW_RES(TB_COLUMN)) )
+
// image resources
, maImgSize (NULL)
, maImgSize_L (NULL)
@@ -158,7 +151,6 @@
, mImgLeft_L (SW_RES(IMG_PAGE_COLUMN_LEFT_L))
, mImgRight_L (SW_RES(IMG_PAGE_COLUMN_RIGHT_L))
, mImgColumnNone_L (SW_RES(IMG_PAGE_COLUMN_NONE_L))
-
, mpPageItem( new SvxPageItem(SID_ATTR_PAGE) )
, mpPageLRMarginItem( new SvxLongLRSpaceItem( 0, 0, SID_ATTR_PAGE_LRSPACE ) )
, mpPageULMarginItem( new SvxLongULSpaceItem( 0, 0, SID_ATTR_PAGE_ULSPACE ) )
@@ -193,68 +185,46 @@
, mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify( false )
{
+ // visible controls
+ get(mpToolBoxOrientation, "orientation");
+ get(mpToolBoxMargin, "margin");
+ get(mpToolBoxSize, "size");
+ get(mpToolBoxColumn, "column");
+
Initialize();
mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify = true;
- FreeResource();
}
PagePropertyPanel::~PagePropertyPanel()
{
delete[] maImgSize;
delete[] maImgSize_L;
-
- // destroy the toolbox windows.
- mpToolBoxOrientation.reset();
- mpToolBoxMargin.reset();
- mpToolBoxSize.reset();
- mpToolBoxColumn.reset();
-
- // destroy the background windows of the toolboxes.
- mpToolBoxOrientationBackground.reset();
- mpToolBoxMarginBackground.reset();
- mpToolBoxSizeBackground.reset();
- mpToolBoxColumnBackground.reset();
}
void PagePropertyPanel::Initialize()
{
- maFtOrientation.SetBackground(Wallpaper());
- maFtMargin.SetBackground(Wallpaper());
- maFtSize.SetBackground(Wallpaper());
- maFtColumn.SetBackground(Wallpaper());
-
// popup for page orientation
+ const sal_uInt16 nIdOrientation = mpToolBoxOrientation->GetItemId(UNO_ORIENTATION);
Link aLink = LINK( this, PagePropertyPanel, ClickOrientationHdl );
mpToolBoxOrientation->SetDropdownClickHdl( aLink );
mpToolBoxOrientation->SetSelectHdl( aLink );
- mpToolBoxOrientation->SetItemImage( TBI_ORIENTATION, mImgPortrait);
- mpToolBoxOrientation->SetItemBits( TBI_ORIENTATION, mpToolBoxOrientation->GetItemBits( TBI_ORIENTATION ) | TIB_DROPDOWNONLY );
- mpToolBoxOrientation->SetQuickHelpText(TBI_ORIENTATION,String(SW_RES(STR_QHELP_TB_ORIENTATION)));
- mpToolBoxOrientation->SetOutputSizePixel( mpToolBoxOrientation->CalcWindowSizePixel() );
- mpToolBoxOrientation->SetBackground( Wallpaper() );
- mpToolBoxOrientation->SetPaintTransparent( sal_True );
+ mpToolBoxOrientation->SetItemImage( nIdOrientation, mImgPortrait);
+ mpToolBoxOrientation->SetItemBits( nIdOrientation, mpToolBoxOrientation->GetItemBits( nIdOrientation ) | TIB_DROPDOWNONLY );
// popup for page margins
+ const sal_uInt16 nIdMargin = mpToolBoxMargin->GetItemId(UNO_MARGIN);
aLink = LINK( this, PagePropertyPanel, ClickMarginHdl );
mpToolBoxMargin->SetDropdownClickHdl( aLink );
mpToolBoxMargin->SetSelectHdl( aLink );
- mpToolBoxMargin->SetItemImage(TBI_MARGIN, mImgNormal);
- mpToolBoxMargin->SetItemBits( TBI_MARGIN, mpToolBoxMargin->GetItemBits( TBI_MARGIN ) | TIB_DROPDOWNONLY );
- mpToolBoxMargin->SetQuickHelpText(TBI_MARGIN,String(SW_RES(STR_QHELP_TB_MARGIN)));
- mpToolBoxMargin->SetOutputSizePixel( mpToolBoxMargin->CalcWindowSizePixel() );
- mpToolBoxMargin->SetBackground(Wallpaper());
- mpToolBoxMargin->SetPaintTransparent( sal_True );
+ mpToolBoxMargin->SetItemImage(nIdMargin, mImgNormal);
+ mpToolBoxMargin->SetItemBits( nIdMargin, mpToolBoxMargin->GetItemBits( nIdMargin ) | TIB_DROPDOWNONLY );
// popup for page size
+ const sal_uInt16 nIdSize = mpToolBoxSize->GetItemId(UNO_SIZE);
aLink = LINK( this, PagePropertyPanel, ClickSizeHdl );
mpToolBoxSize->SetDropdownClickHdl( aLink );
mpToolBoxSize->SetSelectHdl( aLink );
- mpToolBoxSize->SetItemImage(TBI_SIZE, mImgLetter);
- mpToolBoxSize->SetItemBits( TBI_SIZE, mpToolBoxSize->GetItemBits( TBI_SIZE ) | TIB_DROPDOWNONLY );
- mpToolBoxSize->SetQuickHelpText(TBI_SIZE,String(SW_RES(STR_QHELP_TB_SIZE)));
- mpToolBoxSize->SetOutputSizePixel( mpToolBoxSize->CalcWindowSizePixel() );
- mpToolBoxSize->SetBackground(Wallpaper());
- mpToolBoxSize->SetPaintTransparent( sal_True );
+ mpToolBoxSize->SetItemImage(nIdSize, mImgLetter);
maImgSize = new Image[8];
maImgSize[0] = mImgA3;
maImgSize[1] = mImgA4;
@@ -273,17 +243,15 @@
maImgSize_L[5] = mImgC5_L;
maImgSize_L[6] = mImgLetter_L;
maImgSize_L[7] = mImgLegal_L;
+ mpToolBoxSize->SetItemBits( nIdSize, mpToolBoxSize->GetItemBits( nIdSize ) | TIB_DROPDOWNONLY );
// popup for page column property
+ const sal_uInt16 nIdColumn = mpToolBoxColumn->GetItemId(UNO_COLUMN);
aLink = LINK( this, PagePropertyPanel, ClickColumnHdl );
mpToolBoxColumn->SetDropdownClickHdl( aLink );
mpToolBoxColumn->SetSelectHdl( aLink );
- mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn1);
- mpToolBoxColumn->SetItemBits( TBI_COLUMN, mpToolBoxColumn->GetItemBits( TBI_COLUMN ) | TIB_DROPDOWNONLY );
- mpToolBoxColumn->SetQuickHelpText(TBI_COLUMN,String(SW_RES(STR_QHELP_TB_COLUMN)));
- mpToolBoxColumn->SetOutputSizePixel( mpToolBoxColumn->CalcWindowSizePixel() );
- mpToolBoxColumn->SetBackground(Wallpaper());
- mpToolBoxColumn->SetPaintTransparent( sal_True );
+ mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumn1);
+ mpToolBoxColumn->SetItemBits( nIdColumn, mpToolBoxColumn->GetItemBits( nIdColumn ) | TIB_DROPDOWNONLY );
meFUnit = GetModuleFieldUnit();
meUnit = m_aSwPagePgSizeControl.GetCoreMetric();
@@ -375,8 +343,6 @@
}
-
-
::svx::sidebar::PopupControl* PagePropertyPanel::CreatePageMarginControl( ::svx::sidebar::PopupContainer* pParent )
{
return new PageMarginControl(
@@ -400,6 +366,7 @@
mpPageLRMarginItem->SetRight( nPageRightMargin );
GetBindings()->GetDispatcher()->Execute( SID_ATTR_PAGE_LRSPACE, SFX_CALLMODE_RECORD, mpPageLRMarginItem.get(), 0L );
}
+
void PagePropertyPanel::ExecuteMarginULChange(
const long nPageTopMargin,
@@ -430,8 +397,6 @@
{
maMarginPopup.Hide();
}
-
-
::svx::sidebar::PopupControl* PagePropertyPanel::CreatePageSizeControl( ::svx::sidebar::PopupContainer* pParent )
@@ -505,8 +470,6 @@
}
-
-
void PagePropertyPanel::NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
@@ -549,20 +512,21 @@
if ( eState >= SFX_ITEM_AVAILABLE &&
pState && pState->ISA(SvxPageItem) )
{
+ const sal_uInt16 nIdOrientation = mpToolBoxOrientation->GetItemId(UNO_ORIENTATION);
mpPageItem.reset( static_cast<SvxPageItem*>(pState->Clone()) );
if ( mpPageItem->IsLandscape() )
{
- mpToolBoxOrientation->SetItemImage(TBI_ORIENTATION, mImgLandscape);
+ mpToolBoxOrientation->SetItemImage(nIdOrientation, mImgLandscape);
}
else
{
- mpToolBoxOrientation->SetItemImage(TBI_ORIENTATION, mImgPortrait);
+ mpToolBoxOrientation->SetItemImage(nIdOrientation, mImgPortrait);
}
ChangeMarginImage();
ChangeSizeImage();
ChangeColumnImage( mpPageColumnTypeItem->GetValue() );
}
- break;
+ break;
case SID_ATTR_PAGE_SIZE:
if ( mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify )
@@ -626,37 +590,38 @@
}
const long cTolerance = 5;
+ const sal_uInt16 nIdMargin = mpToolBoxMargin->GetItemId(UNO_MARGIN);
if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_NARROW_VALUE) <= cTolerance &&
abs(mpPageLRMarginItem->GetRight() - SWPAGE_NARROW_VALUE) <= cTolerance &&
abs(mpPageULMarginItem->GetUpper() - SWPAGE_NARROW_VALUE) <= cTolerance &&
abs(mpPageULMarginItem->GetLower() - SWPAGE_NARROW_VALUE) <= cTolerance &&
mpPageItem->GetPageUsage() != SVX_PAGE_MIRROR )
- mpToolBoxMargin->SetItemImage( TBI_MARGIN, mpPageItem->IsLandscape() ? mImgNarrow_L : mImgNarrow );
+ mpToolBoxMargin->SetItemImage( nIdMargin, mpPageItem->IsLandscape() ? mImgNarrow_L : mImgNarrow );
else if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_NORMAL_VALUE) <= cTolerance &&
abs(mpPageLRMarginItem->GetRight() - SWPAGE_NORMAL_VALUE) <= cTolerance &&
abs(mpPageULMarginItem->GetUpper() - SWPAGE_NORMAL_VALUE) <= cTolerance &&
abs(mpPageULMarginItem->GetLower() - SWPAGE_NORMAL_VALUE) <= cTolerance &&
mpPageItem->GetPageUsage() != SVX_PAGE_MIRROR )
- mpToolBoxMargin->SetItemImage(TBI_MARGIN, mpPageItem->IsLandscape() ? mImgNormal_L : mImgNormal );
+ mpToolBoxMargin->SetItemImage( nIdMargin, mpPageItem->IsLandscape() ? mImgNormal_L : mImgNormal );
else if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_WIDE_VALUE2) <= cTolerance &&
abs(mpPageLRMarginItem->GetRight() - SWPAGE_WIDE_VALUE2) <= cTolerance &&
abs(mpPageULMarginItem->GetUpper() - SWPAGE_WIDE_VALUE1) <= cTolerance &&
abs(mpPageULMarginItem->GetLower() - SWPAGE_WIDE_VALUE1) <= cTolerance &&
mpPageItem->GetPageUsage() != SVX_PAGE_MIRROR )
- mpToolBoxMargin->SetItemImage(TBI_MARGIN, mpPageItem->IsLandscape() ? mImgWide_L : mImgWide );
+ mpToolBoxMargin->SetItemImage( nIdMargin, mpPageItem->IsLandscape() ? mImgWide_L : mImgWide );
else if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_WIDE_VALUE3) <= cTolerance &&
abs(mpPageLRMarginItem->GetRight() - SWPAGE_WIDE_VALUE1) <= cTolerance &&
abs(mpPageULMarginItem->GetUpper() - SWPAGE_WIDE_VALUE1) <= cTolerance &&
abs(mpPageULMarginItem->GetLower() - SWPAGE_WIDE_VALUE1) <= cTolerance &&
mpPageItem->GetPageUsage() == SVX_PAGE_MIRROR )
- mpToolBoxMargin->SetItemImage(TBI_MARGIN, mpPageItem->IsLandscape() ? mImgMirrored_L : mImgMirrored );
+ mpToolBoxMargin->SetItemImage( nIdMargin, mpPageItem->IsLandscape() ? mImgMirrored_L : mImgMirrored );
else
- mpToolBoxMargin->SetItemImage(TBI_MARGIN, mpPageItem->IsLandscape() ? mImgMarginCustom_L : mImgMarginCustom );
+ mpToolBoxMargin->SetItemImage( nIdMargin, mpPageItem->IsLandscape() ? mImgMarginCustom_L : mImgMarginCustom );
}
@@ -709,14 +674,16 @@
break;
}
+ const sal_uInt16 nIdSize = mpToolBoxSize->GetItemId(UNO_SIZE);
+
if ( nImageIdx == 0 )
{
- mpToolBoxSize->SetItemImage( TBI_SIZE,
+ mpToolBoxSize->SetItemImage( nIdSize,
( mpPageItem->IsLandscape() ? mImgSizeNone_L : mImgSizeNone ) );
}
else
{
- mpToolBoxSize->SetItemImage( TBI_SIZE,
+ mpToolBoxSize->SetItemImage( nIdSize,
( mpPageItem->IsLandscape() ? maImgSize_L[nImageIdx-1] : maImgSize[nImageIdx-1] ) );
}
}
@@ -729,27 +696,28 @@
return;
}
+ const sal_uInt16 nIdColumn = mpToolBoxColumn->GetItemId(UNO_COLUMN);
if ( !mpPageItem->IsLandscape() )
{
switch( nColumnType )
{
case 1:
- mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn1);
+ mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumn1);
break;
case 2:
- mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn2);
+ mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumn2);
break;
case 3:
- mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn3);
+ mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumn3);
break;
case 4:
- mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgLeft);
+ mpToolBoxColumn->SetItemImage(nIdColumn, mImgLeft);
break;
case 5:
- mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgRight);
+ mpToolBoxColumn->SetItemImage(nIdColumn, mImgRight);
break;
default:
- mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumnNone);
+ mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumnNone);
}
}
else
@@ -757,22 +725,22 @@
switch( nColumnType )
{
case 1:
- mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn1_L);
+ mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumn1_L);
break;
case 2:
- mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn2_L);
+ mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumn2_L);
break;
case 3:
- mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn3_L);
+ mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumn3_L);
break;
case 4:
- mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgLeft_L);
+ mpToolBoxColumn->SetItemImage(nIdColumn, mImgLeft_L);
break;
case 5:
- mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgRight_L);
+ mpToolBoxColumn->SetItemImage(nIdColumn, mImgRight_L);
break;
default:
- mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumnNone_L);
+ mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumnNone_L);
}
}
}
diff --git a/sw/source/ui/sidebar/PagePropertyPanel.hrc b/sw/source/ui/sidebar/PagePropertyPanel.hrc
index a4592ae..8eb064d 100644
--- a/sw/source/ui/sidebar/PagePropertyPanel.hrc
+++ b/sw/source/ui/sidebar/PagePropertyPanel.hrc
@@ -17,15 +17,6 @@
*/
#include "PropertyPanel.hrc"
-#define FT_ORIENTATION 1
-#define TB_ORIENTATION 2
-#define FT_MARGIN 3
-#define TB_MARGIN 4
-#define FT_SIZE 5
-#define TB_SIZE 6
-#define FT_COLUMN 7
-#define TB_COLUMN 8
-#define TBI_MARGIN 9
#define IMG_PORTRAIT 10
#define IMG_LANDSCAPE 11
#define STR_PORTRAIT 12
@@ -38,13 +29,11 @@
#define MF_SWRIGHT_MARGIN 19
#define MF_SWTOP_MARGIN 20
#define MF_SWBOTTOM_MARGIN 21
-#define TBI_SIZE 22
#define VS_SIZE 23
#define STR_LCVALUE 24
#define FT_CUSTOM 25
#define FLD_WIDTH_HEIGHT 26
-#define TBI_ORIENTATION 28
#define VS_ORIENTATION 29
#define IMG_PAGE_PORTRAIT 30
#define IMG_PAGE_LANDSCAPE 31
@@ -64,7 +53,6 @@
#define FT_BOTTOM 45
#define FT_INNER 46
#define FT_OUTER 47
-#define TBI_COLUMN 48
#define VS_COLUMN 49
#define MBOX_WIDTH 50
#define IMG_ONE 51
@@ -135,10 +123,6 @@
#define FLD_TOP_MARGIN 115
#define FLD_BOTTOM_MARGIN 116
-#define STR_QHELP_TB_ORIENTATION 117
-#define STR_QHELP_TB_MARGIN 118
-#define STR_QHELP_TB_SIZE 119
-#define STR_QHELP_TB_COLUMN 120
#define IMG_CUSTOM_DIS 121
//
#define STR_MARGIN_TOOLTIP_LEFT 122
@@ -193,4 +177,4 @@
#define MARGIN_PANEL_HEIGHT POP_BORDER_Y + BD_HEIGHT + POPUP_MARGIN + OFFSET_Y
#define CUST_MORE_BUTTON_IMG_OFF_X POPUPPANEL_MARGIN_HORIZONTAL + OFFSET_X
-#define PAGE_HEIGHT TBX_COLUMN_Y + 20 + SECTIONPAGE_MARGIN_VERTICAL_BOT
\ No newline at end of file
+#define PAGE_HEIGHT TBX_COLUMN_Y + 20 + SECTIONPAGE_MARGIN_VERTICAL_BOT
diff --git a/sw/source/ui/sidebar/PagePropertyPanel.hxx b/sw/source/ui/sidebar/PagePropertyPanel.hxx
index 095d073..14d5087 100644
--- a/sw/source/ui/sidebar/PagePropertyPanel.hxx
+++ b/sw/source/ui/sidebar/PagePropertyPanel.hxx
@@ -22,6 +22,7 @@
#include <com/sun/star/document/XUndoManager.hpp>
#include <svx/sidebar/Popup.hxx>
+#include <svx/sidebar/PanelLayout.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
@@ -52,7 +53,7 @@
namespace sw { namespace sidebar {
class PagePropertyPanel
- : public Control,
+ : public PanelLayout,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
@@ -109,18 +110,10 @@
SfxBindings* mpBindings;
// toolboxes - on click open corresponding popup
- FixedText maFtOrientation;
- ::boost::scoped_ptr<Window> mpToolBoxOrientationBackground;
- ::boost::scoped_ptr<ToolBox> mpToolBoxOrientation;
- FixedText maFtMargin;
- ::boost::scoped_ptr<Window> mpToolBoxMarginBackground;
- ::boost::scoped_ptr<ToolBox> mpToolBoxMargin;
- FixedText maFtSize;
- ::boost::scoped_ptr<Window> mpToolBoxSizeBackground;
- ::boost::scoped_ptr<ToolBox> mpToolBoxSize;
- FixedText maFtColumn;
- ::boost::scoped_ptr<Window> mpToolBoxColumnBackground;
- ::boost::scoped_ptr<ToolBox> mpToolBoxColumn;
+ ToolBox* mpToolBoxOrientation;
+ ToolBox* mpToolBoxMargin;
+ ToolBox* mpToolBoxSize;
+ ToolBox* mpToolBoxColumn;
Image* maImgSize;
Image* maImgSize_L;
diff --git a/sw/source/ui/sidebar/PagePropertyPanel.src b/sw/source/ui/sidebar/PagePropertyPanel.src
index d03f2d1..933e174 100644
--- a/sw/source/ui/sidebar/PagePropertyPanel.src
+++ b/sw/source/ui/sidebar/PagePropertyPanel.src
@@ -31,122 +31,6 @@
HelpID = HID_PROPERTYPANEL_SWPAGE_SECTION;
Text = "Page";
- FixedText FT_ORIENTATION
- {
- Pos = MAP_APPFONT ( FT_ORIENTATION_X, FT_ORIENTATION_Y );
- Size = MAP_APPFONT ( MBOX_WIDTH, TEXT_HEIGHT) ;
- Text [ en-US ] = "~Orientation:";
- };
- ToolBox TB_ORIENTATION
- {
- Pos = MAP_APPFONT (TBX_ORIENTATION_X, TBX_ORIENTATION_Y) ;
- HelpID = HID_SWPAGE_ORIENTATION;
- SVLook = TRUE ;
- TabStop = TRUE ;
- Text = "Orientation" ;
- ItemList =
- {
- ToolBoxItem
- {
- HelpID = HID_SWPAGE_TBI_ORIENTATION;
- Identifier = TBI_ORIENTATION ;
- Text [ en-US ] = "Orientation" ;
- DropDown = TRUE ;
- };
- };
- };
- String STR_QHELP_TB_ORIENTATION
- {
- Text [ en-US ] = "Select the paper orientation - vertically (portrait) or horizontally (landscape) - for the current page style.";
- };
-
- FixedText FT_MARGIN
- {
- Pos = MAP_APPFONT ( FT_MARGIN_X, FT_MARGIN_Y );
- Size = MAP_APPFONT ( MBOX_WIDTH + 50, TEXT_HEIGHT) ;
- Text [ en-US ] = "~Margin:";
- };
- ToolBox TB_MARGIN
- {
- SVLook = TRUE ;
- Pos = MAP_APPFONT (TBX_MARGIN_X, TBX_MARGIN_Y) ;
- HelpID = HID_SWPAGE_MARGIN;
- TabStop = TRUE ;
- Text = "Margin" ;
- ItemList =
- {
- ToolBoxItem
- {
- HelpID = HID_SWPAGE_TBI_MARGIN;
- Identifier = TBI_MARGIN ;
- Text [ en-US ] = "Margin" ;
- DropDown = TRUE ;
- };
- };
- };
- String STR_QHELP_TB_MARGIN
- {
- Text [ en-US ] = "Select the margin values for the current page style.";
- };
-
- FixedText FT_SIZE
- {
- Pos = MAP_APPFONT ( FT_SIZE_X, FT_SIZE_Y );
- Size = MAP_APPFONT ( MBOX_WIDTH, TEXT_HEIGHT) ;
- Text [ en-US ] = "~Size:";
- };
- ToolBox TB_SIZE
- {
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( TBX_SIZE_X , TBX_SIZE_Y ) ;
- HelpID = HID_SWPAGE_SIZE;
- TabStop = TRUE ;
- Text = "Size" ;
- ItemList =
- {
- ToolBoxItem
- {
- HelpID = HID_SWPAGE_TBI_SIZE;
- Identifier = TBI_SIZE ;
- Text [ en-US ] = "Size" ;
- DropDown = TRUE ;
- };
- };
- };
- String STR_QHELP_TB_SIZE
- {
- Text [ en-US ] = "Select a predefined paper size for the current page style.";
- };
-
- FixedText FT_COLUMN
- {
- Pos = MAP_APPFONT ( FT_COLUMN_X, FT_COLUMN_Y );
- Size = MAP_APPFONT ( MBOX_WIDTH + 50, TEXT_HEIGHT) ;
- Text [ en-US ] = "~Column:";
- };
- ToolBox TB_COLUMN
- {
- SVLook = TRUE ;
- Pos = MAP_APPFONT ( TBX_COLUMN_X , TBX_COLUMN_Y ) ;
- HelpID = HID_SWPAGE_COLUMN;
- TabStop = TRUE ;
- Text = "Column" ;
- ItemList =
- {
- ToolBoxItem
- {
- HelpID = HID_SWPAGE_TBI_COLUMN;
- Identifier = TBI_COLUMN;
- Text [ en-US ] = "Column" ;
- DropDown = TRUE ;
- };
- };
- };
- String STR_QHELP_TB_COLUMN
- {
- Text [ en-US ] = "Select the layout and the number of columns for the current page style.";
- };
-
Image IMG_PAGE_PORTRAIT
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/portraitcopy_24x24.png";};
diff --git a/sw/uiconfig/swriter/ui/sidebarpage.ui b/sw/uiconfig/swriter/ui/sidebarpage.ui
new file mode 100644
index 0000000..05fd516
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/sidebarpage.ui
@@ -0,0 +1,249 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkGrid" id="PagePropertyPanel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_homogeneous">True</property>
+ <property name="column_homogeneous">True</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_bottom">30</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="orientationlabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_right">23</property>
+ <property name="label" translatable="yes">_Orientation:</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolbar" id="selectorientation">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuToolButton" id="orientation">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Select the paper orientation - vertically (portrait) or horizontally (landscape) - for the current page style.</property>
+ <property name="action_name">.uno:Orientation</property>
+ <property name="label" translatable="yes">toolbutton1</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_bottom">30</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="marginlabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_right">37</property>
+ <property name="label" translatable="yes">_Margin:</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolbar" id="selectmargin">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuToolButton" id="margin">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Select the margin values for the current page style.</property>
+ <property name="action_name">.uno:Margin</property>
+ <property name="label" translatable="yes">toolbutton2</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="sizelabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_right">67</property>
+ <property name="label" translatable="yes">_Size:</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolbar" id="selectsize">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuToolButton" id="size">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Select a predefined paper size for the current page style.</property>
+ <property name="margin_bottom">25</property>
+ <property name="action_name">.uno:Size</property>
+ <property name="label" translatable="yes">toolbutton3</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="columnlabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_right">30</property>
+ <property name="label" translatable="yes">_Column:</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkToolbar" id="selectcolumn">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkMenuToolButton" id="column">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Select the layout and the number of columns for the current page style.</property>
+ <property name="margin_right">15</property>
+ <property name="margin_bottom">25</property>
+ <property name="action_name">.uno:Column</property>
+ <property name="label" translatable="yes">toolbutton4</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+</interface>
--
To view, visit https://gerrit.libreoffice.org/4298
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ffc36fa8d3c6656392354864092f6cbc7e3c30d
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Prashant Pandey <prashant3.yishu at gmail.com>
More information about the LibreOffice
mailing list