sidebar: Get AreaPropertyPanel basically to work.

Change-Id: Ib5f05346ab5b38b4f3ec30f95b2435c9231d13ab
This commit is contained in:
Jan Holesovsky
2013-07-15 13:37:39 +02:00
parent 8fe5f01153
commit 94c8113897
5 changed files with 193 additions and 223 deletions

View File

@@ -1004,9 +1004,6 @@
// sidebar-related resources (defined in the appropriate .hrc's)
#define RID_SVX_SIDEBAR_BEGIN (RID_SVX_START + 1240)
// sidebar-related resources (defined in the appropriate .hrc's)
#define RID_SVX_SIDEBAR_BEGIN (RID_SVX_START + 1240)
// !!! IMPORTANT: consider and update RID_SVXSTR_NEXTFREE when introducing new RIDs for Strings !!!
#define RID_SVXSTR_NEXTFREE (RID_SVX_START + 1270)

View File

@@ -77,8 +77,6 @@ AreaPropertyPanel::AreaPropertyPanel(
maGradientElliptical(),
maGradientSquare(),
maGradientRect(),
mpLbFillType(new SvxFillTypeBox(this)),
mpLbFillAttr(new SvxFillAttrBox(this)),
mpStyleItem(),
mpColorItem(),
mpFillGradientItem(),
@@ -113,11 +111,13 @@ AreaPropertyPanel::AreaPropertyPanel(
mbColorAvail(true)
{
get(mpColorTextFT, "filllabel");
get(mpLbFillType, "fillstyle");
get(mpLbFillAttr, "fillattr");
get(mpTrspTextFT, "transparencylabel");
get(mpToolBoxColor, "selectcolor");
get(mpLBTransType, "transtype");
get(mpMTRTransparent, "settransparency"); // GtkSpinButton
get(mpBTNGradient, "selectgradient"); // GtkToolbar
get(mpMTRTransparent, "settransparency");
get(mpBTNGradient, "selectgradient");
const sal_uInt16 nIdColor = mpToolBoxColor->GetItemId(UNO_SIDEBARCOLOR);
mpColorUpdater.reset(new ::svx::ToolboxButtonColorUpdater(SID_ATTR_FILL_COLOR, nIdColor, mpToolBoxColor)),
@@ -158,27 +158,6 @@ void AreaPropertyPanel::Initialize()
maGradientRect = maGradientLinear;
maGradientRect.SetGradientStyle(XGRAD_RECT);
Size aLogicalFillSize(MBOX_WIDTH,LISTBOX_HEIGHT);
Size aLogicalAttrSize(MBOX_WIDTH + 1,LISTBOX_HEIGHT);
Point aPoint(SECTIONPAGE_MARGIN_HORIZONTAL,SECTIONPAGE_MARGIN_VERTICAL_TOP + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL);
Point aPoint_Picker(SECTIONPAGE_MARGIN_HORIZONTAL + MBOX_WIDTH + CONTROL_SPACING_HORIZONTAL,SECTIONPAGE_MARGIN_VERTICAL_TOP + FIXED_TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL);
Size aTypeSize(LogicToPixel(aLogicalFillSize, MAP_APPFONT));
Size aAttrSize(LogicToPixel(aLogicalAttrSize, MAP_APPFONT));
Point aTypePoint(LogicToPixel(aPoint, MAP_APPFONT));
Point aAttrPoint(LogicToPixel(aPoint_Picker, MAP_APPFONT));
mpLbFillType->SetPosSizePixel(aTypePoint,aTypeSize);
mpLbFillAttr->SetPosSizePixel(aAttrPoint,aAttrSize);
mpLbFillType->SetHelpId(HID_PPROPERTYPANEL_AREA_LB_FILL_TYPES);
mpLbFillAttr->SetHelpId(HID_PPROPERTYPANEL_AREA_LB_FILL_ATTR);
mpLbFillType->SetQuickHelpText(msHelpFillType);
mpLbFillAttr->SetQuickHelpText(msHelpFillAttr);
mpLbFillType->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Fill"))); //wj acc
mpLbFillAttr->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Fill"))); //wj acc
@@ -195,12 +174,6 @@ void AreaPropertyPanel::Initialize()
mpToolBoxColor->SetItemBits( nIdColor, mpToolBoxColor->GetItemBits( nIdColor ) | TIB_DROPDOWNONLY );
mpToolBoxColor->SetItemText(nIdColor, msHelpFillAttr);
long aHeightLBStyle = mpLbFillType->GetSizePixel().getHeight();
long aLBPosY = mpLbFillType->GetPosPixel().getY();
long aHeightTBAttr = mpToolBoxColor->GetSizePixel().getHeight();
Point aPointTBAttr = mpToolBoxColor->GetPosPixel();
aPointTBAttr.setY( aLBPosY + aHeightLBStyle / 2 - aHeightTBAttr / 2);
aLink = LINK(this, AreaPropertyPanel, ToolBoxColorDropHdl);
mpToolBoxColor->SetDropdownClickHdl ( aLink );
mpToolBoxColor->SetSelectHdl ( aLink );
@@ -221,19 +194,8 @@ void AreaPropertyPanel::Initialize()
mpBTNGradient->SetItemImage(nIdGradient,maImgLinear);
mpBTNGradient->Hide();
long aHeightLBTrans = mpLBTransType->GetSizePixel().getHeight();
Point aPointLB = mpLBTransType->GetPosPixel();
long aPosY = aPointLB.getY();
Point aPointMetric = mpMTRTransparent->GetPosPixel();
Point aPointTB = mpMTRTransparent->GetPosPixel();
long aHeightMetric = mpMTRTransparent->GetSizePixel().getHeight();
long aHeightTool = mpBTNGradient->GetSizePixel().getHeight();
aPointMetric.setY(aPosY+aHeightLBTrans/2-aHeightMetric/2);
aPointTB.setY(aPosY+aHeightLBTrans/2-aHeightTool/2);
aPointTB.setX(aPointTB.getX()+3);
mpLbFillType->SetAccessibleRelationLabeledBy(mpColorTextFT);
mpLbFillAttr->SetAccessibleRelationLabeledBy(mpLbFillAttr.get());
mpLbFillAttr->SetAccessibleRelationLabeledBy(mpLbFillAttr);
mpToolBoxColor->SetAccessibleRelationLabeledBy(mpToolBoxColor);
mpLBTransType->SetAccessibleRelationLabeledBy(mpTrspTextFT);
mpMTRTransparent->SetAccessibleRelationLabeledBy(mpMTRTransparent);

View File

@@ -100,8 +100,8 @@ private:
//ui controls
FixedText* mpColorTextFT;
::boost::scoped_ptr< SvxFillTypeBox > mpLbFillType;
::boost::scoped_ptr< SvxFillAttrBox > mpLbFillAttr;
SvxFillTypeBox* mpLbFillType;
SvxFillAttrBox* mpLbFillAttr;
ToolBox* mpToolBoxColor; // for new color picker
FixedText* mpTrspTextFT;
ListBox* mpLBTransType;

View File

@@ -609,6 +609,11 @@ SvxFillTypeBox::SvxFillTypeBox( Window* pParent, WinBits nBits ) :
Show();
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxFillTypeBox(Window *pParent, VclBuilder::stringmap &)
{
return new SvxFillTypeBox(pParent);
}
// -----------------------------------------------------------------------
SvxFillTypeBox::~SvxFillTypeBox()
@@ -697,6 +702,11 @@ SvxFillAttrBox::SvxFillAttrBox( Window* pParent, WinBits nBits ) :
Show();
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxFillAttrBox(Window *pParent, VclBuilder::stringmap &)
{
return new SvxFillAttrBox(pParent);
}
// -----------------------------------------------------------------------
SvxFillAttrBox::~SvxFillAttrBox()

View File

@@ -15,59 +15,65 @@
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkBox" id="box2">
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="hexpand">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkLabel" id="filllabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Fill:</property>
<property name="tooltip_text" translatable="yes">Fill:</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Fill:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fillstyle</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<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="box5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin_bottom">4</property>
<child>
<object class="GtkComboBoxText" id="fillstyle">
<object class="svxlo-SvxFillTypeBox" id="fillstyle">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Select the fill type to apply.</property>
<property name="tooltip_text" translatable="yes">Select the fill type to apply.</property>
<property name="entry_text_column">0</property>
<property name="id_column">1</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<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="box8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<child>
<object class="GtkToolbar" id="selectcolor">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkMenuToolButton" id="color">
<property name="width_request">105</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Select the color to apply.</property>
<property name="tooltip_text" translatable="yes">Select the color to apply.</property>
<property name="halign">end</property>
<property name="action_name">.uno:sidebarcolor</property>
<property name="use_underline">True</property>
</object>
@@ -80,51 +86,52 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</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="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box4">
<object class="svxlo-SvxFillAttrBox" id="fillattr">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
</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>
<child>
<object class="GtkLabel" id="transparencylabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Transparency</property>
<property name="tooltip_text" translatable="yes">Transparency</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Transparency:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">transtype</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="left_attach">0</property>
<property name="top_attach">2</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>
<child>
<object class="GtkComboBoxText" id="transtype">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Select the type of transparence to apply.</property>
<property name="tooltip_text" translatable="yes">Select the type of transparence to apply.</property>
<property name="entry_text_column">0</property>
@@ -141,40 +148,21 @@
</items>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box7">
<object class="GtkBox" id="box9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkSpinButton" id="settransparency:0%">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_markup" translatable="yes">Specify 0% for fully opaque through 100% for fully transparent.</property>
<property name="tooltip_text" translatable="yes">Specify 0% for fully opaque through 100% for fully transparent.</property>
<property name="halign">end</property>
<property name="max_length">100</property>
<property name="invisible_char">•</property>
<property name="secondary_icon_activatable">False</property>
<property name="climb_rate">5</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<property name="hexpand">True</property>
<child>
<object class="GtkToolbar" id="selectgradient">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="margin_left">13</property>
<child>
<object class="GtkMenuToolButton" id="gradient">
<property name="visible">True</property>
@@ -182,7 +170,6 @@
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Specify the variation of gradient transparency.</property>
<property name="tooltip_text" translatable="yes">Specify the variation of gradient transparency.</property>
<property name="margin_left">23</property>
<property name="action_name">.uno:sidebargradient</property>
<property name="use_underline">True</property>
</object>
@@ -195,9 +182,23 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="settransparency:0%">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Specify 0% for fully opaque through 100% for fully transparent.</property>
<property name="tooltip_text" translatable="yes">Specify 0% for fully opaque through 100% for fully transparent.</property>
<property name="hexpand">True</property>
<property name="max_length">100</property>
<property name="invisible_char">•</property>
<property name="invisible_char_set">True</property>
<property name="secondary_icon_activatable">False</property>
<property name="climb_rate">5</property>
<property name="numeric">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -207,17 +208,17 @@
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="left_attach">1</property>
<property name="top_attach">3</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">1</property>
</packing>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>