Kaydet (Commit) 14b0715b authored tarafından Prashant Pandey's avatar Prashant Pandey Kaydeden (comit) Jan Holesovsky

sidebar: SidebarGraphicPanel conversion to .ui

Change-Id: Iac55960a2f0fd586961abc5cbf239e06a97e088c
üst a9ae9aef
......@@ -70,7 +70,6 @@ $(eval $(call gb_SrsTarget_add_files,svx/res,\
svx/source/items/svxitems.src \
svx/source/sidebar/EmptyPanel.src \
svx/source/sidebar/area/AreaPropertyPanel.src \
svx/source/sidebar/graphic/GraphicPropertyPanel.src \
svx/source/sidebar/line/LinePropertyPanel.src \
svx/source/sidebar/text/TextPropertyPanel.src \
svx/source/sidebar/paragraph/ParaPropertyPanel.src \
......
......@@ -23,6 +23,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/redlinefilterpage \
svx/uiconfig/ui/redlineviewpage \
svx/uiconfig/ui/sidebararea \
svx/uiconfig/ui/sidebargraphic \
svx/uiconfig/ui/sidebarinsert \
svx/uiconfig/ui/sidebarline \
svx/uiconfig/ui/sidebarparagraph \
......
......@@ -19,7 +19,6 @@
#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sidebar/ControlFactory.hxx>
#include <GraphicPropertyPanel.hxx>
#include <GraphicPropertyPanel.hrc>
#include <svx/dialogs.hrc>
#include <svx/dialmgr.hxx>
#include <vcl/field.hxx>
......@@ -46,21 +45,7 @@ GraphicPropertyPanel::GraphicPropertyPanel(
Window* pParent,
const cssu::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
: Control(
pParent,
SVX_RES(RID_SIDEBAR_GRAPHIC_PANEL)),
mpFtBrightness(new FixedText(this, SVX_RES(FT_BRIGHTNESS))),
mpMtrBrightness(new MetricField(this, SVX_RES(MTR_BRIGHTNESS))),
mpFtContrast(new FixedText(this, SVX_RES(FT_CONTRAST))),
mpMtrContrast(new MetricField(this, SVX_RES(MTR_CONTRAST))),
mpFtColorMode(new FixedText(this, SVX_RES(FT_COLOR_MODE))),
mpLBColorMode(new ListBox(this, SVX_RES(LB_COLOR_MODE))),
mpFtTrans(new FixedText(this, SVX_RES(FT_TRANSPARENT))),
mpMtrTrans(new MetricField(this, SVX_RES(MTR_TRANSPARENT))),
mpMtrRed(new MetricField(this, SVX_RES(MF_RED))),
mpMtrGreen(new MetricField(this, SVX_RES(MF_GREEN))),
mpMtrBlue(new MetricField(this, SVX_RES(MF_BLUE))),
mpMtrGamma(new MetricField(this, SVX_RES(MF_GAMMA))),
: PanelLayout(pParent, "GraphicPropertyPanel", "svx/ui/sidebargraphic.ui", rxFrame),
maBrightControl(SID_ATTR_GRAF_LUMINANCE, *pBindings, *this),
maContrastControl(SID_ATTR_GRAF_CONTRAST, *pBindings, *this),
maTransparenceControl(SID_ATTR_GRAF_TRANSPARENCE, *pBindings, *this),
......@@ -69,15 +54,18 @@ GraphicPropertyPanel::GraphicPropertyPanel(
maBlueControl(SID_ATTR_GRAF_BLUE, *pBindings, *this),
maGammaControl(SID_ATTR_GRAF_GAMMA, *pBindings, *this),
maModeControl(SID_ATTR_GRAF_MODE, *pBindings, *this),
maImgRed(this, SVX_RES(IMG_RED)),
maImgGreen(this, SVX_RES(IMG_GREEN)),
maImgBlue(this, SVX_RES(IMG_BLUE)),
maImgGamma(this, SVX_RES(IMG_GAMMA)),
mxFrame(rxFrame),
mpBindings(pBindings)
{
get(mpMtrBrightness, "setbrightness");
get(mpMtrContrast, "setcontrast");
get(mpLBColorMode, "setcolormode");
get(mpMtrTrans, "settransparency");
get(mpMtrRed, "setred");
get(mpMtrGreen, "setgreen");
get(mpMtrBlue, "setblue");
get(mpMtrGamma, "setgamma");
Initialize();
FreeResource();
}
//////////////////////////////////////////////////////////////////////////////
......@@ -90,11 +78,6 @@ GraphicPropertyPanel::~GraphicPropertyPanel()
void GraphicPropertyPanel::Initialize()
{
mpFtBrightness->SetBackground(Wallpaper());
mpFtContrast->SetBackground(Wallpaper());
mpFtColorMode->SetBackground(Wallpaper());
mpFtTrans->SetBackground(Wallpaper());
mpMtrBrightness->SetModifyHdl( LINK( this, GraphicPropertyPanel, ModifyBrightnessHdl ) );
mpMtrBrightness->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Brightness")));
mpMtrContrast->SetModifyHdl( LINK( this, GraphicPropertyPanel, ModifyContrastHdl ) );
......@@ -118,14 +101,10 @@ void GraphicPropertyPanel::Initialize()
mpMtrBlue->SetAccessibleName(mpMtrBlue->GetQuickHelpText());
mpMtrGamma->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Gamma value")));
mpMtrRed->SetAccessibleRelationLabeledBy(mpMtrRed.get());
mpMtrGreen->SetAccessibleRelationLabeledBy(mpMtrGreen.get());
mpMtrBlue->SetAccessibleRelationLabeledBy(mpMtrBlue.get());
mpMtrGamma->SetAccessibleRelationLabeledBy(mpMtrGamma.get());
mpMtrBrightness->SetAccessibleRelationLabeledBy(mpFtBrightness.get());
mpMtrContrast->SetAccessibleRelationLabeledBy(mpFtContrast.get());
mpMtrTrans->SetAccessibleRelationLabeledBy(mpFtTrans.get());
mpLBColorMode->SetAccessibleRelationLabeledBy(mpFtColorMode.get());
mpMtrRed->SetAccessibleRelationLabeledBy(mpMtrRed);
mpMtrGreen->SetAccessibleRelationLabeledBy(mpMtrGreen);
mpMtrBlue->SetAccessibleRelationLabeledBy(mpMtrBlue);
mpMtrGamma->SetAccessibleRelationLabeledBy(mpMtrGamma);
// Fix left position of some controls that may be wrong due to
// rounding errors.
......
/*
* 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 .
*/
// RID_SIDEBAR_GRAPHIC_PANEL--------------------------------------------------------------
#define FT_BRIGHTNESS 1
#define MTR_BRIGHTNESS 2
#define FT_CONTRAST 3
#define MTR_CONTRAST 4
#define FT_TRANSPARENT 5
#define MTR_TRANSPARENT 6
#define FT_COLOR_MODE 10
#define LB_COLOR_MODE 11
#define MBOX_WIDTH 50
#define MF_RED 21
#define MF_GREEN 22
#define MF_BLUE 23
#define MF_GAMMA 24
#define IMG_RED 25
#define IMG_GREEN 26
#define IMG_BLUE 27
#define IMG_GAMMA 28
......@@ -21,6 +21,7 @@
#include <vcl/ctrl.hxx>
#include <sfx2/sidebar/SidebarPanelBase.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <vcl/fixed.hxx>
#include <boost/scoped_ptr.hpp>
......@@ -33,7 +34,7 @@ class FloatingWindow;
namespace svx { namespace sidebar {
class GraphicPropertyPanel
: public Control,
: public PanelLayout,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
......@@ -55,18 +56,14 @@ public:
private:
//ui controls
::boost::scoped_ptr< FixedText > mpFtBrightness;
::boost::scoped_ptr< MetricField > mpMtrBrightness;
::boost::scoped_ptr< FixedText > mpFtContrast;
::boost::scoped_ptr< MetricField > mpMtrContrast;
::boost::scoped_ptr< FixedText > mpFtColorMode;
::boost::scoped_ptr< ListBox > mpLBColorMode;
::boost::scoped_ptr< FixedText > mpFtTrans;
::boost::scoped_ptr< MetricField > mpMtrTrans;
::boost::scoped_ptr< MetricField > mpMtrRed;
::boost::scoped_ptr< MetricField > mpMtrGreen;
::boost::scoped_ptr< MetricField > mpMtrBlue;
::boost::scoped_ptr< MetricField > mpMtrGamma;
MetricField* mpMtrBrightness;
MetricField* mpMtrContrast;
ListBox* mpLBColorMode;
MetricField* mpMtrTrans;
MetricField* mpMtrRed;
MetricField* mpMtrGreen;
MetricField* mpMtrBlue;
MetricField* mpMtrGamma;
::sfx2::sidebar::ControllerItem maBrightControl;
::sfx2::sidebar::ControllerItem maContrastControl;
......@@ -77,16 +74,6 @@ private:
::sfx2::sidebar::ControllerItem maGammaControl;
::sfx2::sidebar::ControllerItem maModeControl;
Image maImgNormal;
Image maImgBW;
Image maImgGray;
Image maImgWater;
FixedImage maImgRed;
FixedImage maImgGreen;
FixedImage maImgBlue;
FixedImage maImgGamma;
String msNormal;
String msBW;
String msGray;
......
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "GraphicPropertyPanel.hrc"
#include <sfx2/sidebar/ResourceDefinitions.hrc>
#include <svx/dialogs.hrc>
#include "helpid.hrc"
#define X0 SECTIONPAGE_MARGIN_HORIZONTAL
#define X1 X0 + 10
#define X2 X0 + MBOX_WIDTH + CONTROL_SPACING_HORIZONTAL
#define X3 X2 + 10
#define Y0 SECTIONPAGE_MARGIN_VERTICAL_TOP
#define Y1 Y0 + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL
#define Y2 Y1 + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
#define Y3 Y2 + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL
#define Y4 Y3 + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
#define Y5 Y4 + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL
#define PAGE_HEIGHT Y5 + MBOX_HEIGHT + SECTIONPAGE_MARGIN_VERTICAL_BOT
Control RID_SIDEBAR_GRAPHIC_PANEL
{
OutputSize = TRUE;
DialogControl = TRUE;
Border = FALSE;
Size = MAP_APPFONT( PROPERTYPAGE_WIDTH, PAGE_HEIGHT );
HelpID = HID_PROPERTYPANEL_GRAPHIC_SECTION ;
Text = "Graphic";
FixedText FT_BRIGHTNESS
{
Pos = MAP_APPFONT (X0, Y0);
Size = MAP_APPFONT ( MBOX_WIDTH , TEXT_HEIGHT ) ;
Text [ en-US ] = "~Brightness:";
};
MetricField MTR_BRIGHTNESS
{
Border = TRUE ;
Pos = MAP_APPFONT (X0, Y1);
Size = MAP_APPFONT ( MBOX_WIDTH , MBOX_HEIGHT ) ;
HelpID = HID_PROPERTY_PANEL_GRAPHIC_MTR_BRIGHT;
QuickHelpText [ en-US ] = "Specify the luminance of the graphic.";
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 100 ;
Minimum = -100 ;
StrictFormat = TRUE ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
SpinSize = 1 ;
};
FixedText FT_CONTRAST
{
Pos = MAP_APPFONT (X2, Y0);
Size = MAP_APPFONT ( MBOX_WIDTH, TEXT_HEIGHT ) ;
Text [ en-US ] = "~Contrast:";
};
MetricField MTR_CONTRAST
{
Border = TRUE ;
Pos = MAP_APPFONT (X2, Y1);
Size = MAP_APPFONT ( MBOX_WIDTH , MBOX_HEIGHT ) ;
HelpID = HID_PROPERTY_PANEL_GRAPHIC_MTR_CONTRAST;
QuickHelpText [ en-US ] = "Specify the degree of difference between the lightest and darkest parts of the graphic.";
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 100 ;
Minimum = -100 ;
StrictFormat = TRUE ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
SpinSize = 1 ;
};
FixedText FT_COLOR_MODE
{
Pos = MAP_APPFONT (X0, Y2);
Size = MAP_APPFONT ( MBOX_WIDTH, TEXT_HEIGHT ) ;
Text [ en-US ] = "Color ~mode:";
};
ListBox LB_COLOR_MODE
{
Border = TRUE ;
Pos = MAP_APPFONT (X0 , Y3) ;
Size = MAP_APPFONT ( MBOX_WIDTH , 100 ) ;
HelpID = HID_PROPERTY_PANEL_GRAPHIC_LB_COLORMODE;
QuickHelpText [ en-US ] = "Select the color mode of the graphic.";
TabStop = TRUE ;
DropDown = TRUE ;
};
FixedText FT_TRANSPARENT
{
Pos = MAP_APPFONT (X2, Y2);
Size = MAP_APPFONT ( MBOX_WIDTH , TEXT_HEIGHT ) ;
Text [ en-US ] = "~Transparency:";
};
MetricField MTR_TRANSPARENT
{
Border = TRUE ;
Pos = MAP_APPFONT (X2, Y3) ;
Size = MAP_APPFONT ( MBOX_WIDTH ,MBOX_HEIGHT ) ;
HelpID = HID_PROPERTY_PANEL_GRAPHIC_MTR_TRANSP;
QuickHelpText [ en-US ] = "Specify the percentage of transparency; 0% is fully opaque and 100% is fully transparent.";
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 100 ;
StrictFormat = TRUE ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
SpinSize = 1 ;
};
MetricField MF_RED
{
Border = TRUE ;
Pos = MAP_APPFONT (X1, Y4) ;
Size = MAP_APPFONT ( MBOX_WIDTH - 10,MBOX_HEIGHT ) ;
HelpID = HID_PROPERTY_PANEL_GRAPHIC_MTR_RED;
QuickHelpText [ en-US ] = "Red";
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 100 ;
Minimum = -100 ;
StrictFormat = TRUE ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
SpinSize = 1 ;
};
MetricField MF_GREEN
{
Border = TRUE ;
Pos = MAP_APPFONT (X3, Y4) ;
Size = MAP_APPFONT ( MBOX_WIDTH - 10 ,MBOX_HEIGHT ) ;
HelpID = HID_PROPERTY_PANEL_GRAPHIC_MTR_GREEN;
QuickHelpText [ en-US ] = "Green";
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 100 ;
Minimum = -100 ;
StrictFormat = TRUE ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
SpinSize = 1 ;
};
MetricField MF_BLUE
{
Border = TRUE ;
Pos = MAP_APPFONT (X1, Y5) ;
Size = MAP_APPFONT ( MBOX_WIDTH - 10 ,MBOX_HEIGHT ) ;
HelpID = HID_PROPERTY_PANEL_GRAPHIC_MTR_BLUE;
QuickHelpText [ en-US ] = "Blue";
TabStop = TRUE ;
Repeat = TRUE ;
Spin = TRUE ;
Maximum = 100 ;
Minimum = -100 ;
StrictFormat = TRUE ;
Unit = FUNIT_CUSTOM ;
CustomUnitText = "%" ;
SpinSize = 1 ;
};
MetricField MF_GAMMA
{
Border = TRUE ;
Pos = MAP_APPFONT (X3, Y5) ;
Size = MAP_APPFONT ( MBOX_WIDTH - 10 ,MBOX_HEIGHT ) ;
HelpID = HID_PROPERTY_PANEL_GRAPHIC_MTR_GAMMA;
QuickHelpText [ en-US ] = "Specify the gamma value that affects the brightness of the midtone values.";
TabStop = TRUE;
Repeat = TRUE;
Spin = TRUE;
Minimum = 10;
Maximum = 1000;
DecimalDigits = 2;
SpinSize = 10;
};
FixedImage IMG_RED
{
Pos = MAP_APPFONT(X0, Y4);
Size = MAP_APPFONT( 10, 12 );
Fixed = Image
{
ImageBitmap = Bitmap { File = "symphony/AdjustColorRed_16x16.png"; };
};
};
FixedImage IMG_GREEN
{
Pos = MAP_APPFONT(X2, Y4);
Size = MAP_APPFONT( 10, 12 );
Fixed = Image
{
ImageBitmap = Bitmap { File = "symphony/AdjustColorGreen_16x16.png"; };
};
};
FixedImage IMG_BLUE
{
Pos = MAP_APPFONT(X0, Y5);
Size = MAP_APPFONT( 10, 12 );
Fixed = Image
{
ImageBitmap = Bitmap { File = "symphony/AdjustColorBlue_16x16.png"; };
};
};
FixedImage IMG_GAMMA
{
Pos = MAP_APPFONT(X2, Y5);
Size = MAP_APPFONT( 10, 12 );
Fixed = Image
{
ImageBitmap = Bitmap { File = "symphony/AdjustColorGamma_16x16.png"; };
};
};
};
// eof
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment