Kaydet (Commit) 618fd9d9 authored tarafından Rishabh Kumar's avatar Rishabh Kumar Kaydeden (comit) Katarina Behrens

Line Controls are disabled when none entry is checked

Change-Id: Ie0ece4ca4b463642ea7b45bd3e27338fa5d3b9b8
Reviewed-on: https://gerrit.libreoffice.org/16146Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarYousuf Philips <philipz85@hotmail.com>
Tested-by: 's avatarYousuf Philips <philipz85@hotmail.com>
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst 611d8ee6
...@@ -177,6 +177,8 @@ LinePropertyPanel::LinePropertyPanel( ...@@ -177,6 +177,8 @@ LinePropertyPanel::LinePropertyPanel(
{ {
get(mpFTWidth, "widthlabel"); get(mpFTWidth, "widthlabel");
get(mpTBWidth, "width"); get(mpTBWidth, "width");
get(mpFTColor, "colorlabel");
get(mpLBColor, "color");
get(mpFTStyle, "stylelabel"); get(mpFTStyle, "stylelabel");
get(mpLBStyle, "linestyle"); get(mpLBStyle, "linestyle");
get(mpFTTransparency, "translabel"); get(mpFTTransparency, "translabel");
...@@ -201,6 +203,8 @@ void LinePropertyPanel::dispose() ...@@ -201,6 +203,8 @@ void LinePropertyPanel::dispose()
{ {
mpFTWidth.clear(); mpFTWidth.clear();
mpTBWidth.clear(); mpTBWidth.clear();
mpFTColor.clear();
mpLBColor.clear();
mpFTStyle.clear(); mpFTStyle.clear();
mpLBStyle.clear(); mpLBStyle.clear();
mpFTTransparency.clear(); mpFTTransparency.clear();
...@@ -285,6 +289,8 @@ void LinePropertyPanel::Initialize() ...@@ -285,6 +289,8 @@ void LinePropertyPanel::Initialize()
aLink = LINK( this, LinePropertyPanel, ChangeCapStyleHdl ); aLink = LINK( this, LinePropertyPanel, ChangeCapStyleHdl );
mpLBCapStyle->SetSelectHdl( aLink ); mpLBCapStyle->SetSelectHdl( aLink );
mpLBCapStyle->SetAccessibleName(OUString("Cap Style")); mpLBCapStyle->SetAccessibleName(OUString("Cap Style"));
ActivateControls();
} }
VclPtr<vcl::Window> LinePropertyPanel::Create ( VclPtr<vcl::Window> LinePropertyPanel::Create (
...@@ -611,6 +617,7 @@ void LinePropertyPanel::NotifyItemUpdate( ...@@ -611,6 +617,7 @@ void LinePropertyPanel::NotifyItemUpdate(
break; break;
} }
} }
ActivateControls();
} }
IMPL_LINK_NOARG(LinePropertyPanel, ChangeLineStyleHdl) IMPL_LINK_NOARG(LinePropertyPanel, ChangeLineStyleHdl)
...@@ -647,7 +654,7 @@ IMPL_LINK_NOARG(LinePropertyPanel, ChangeLineStyleHdl) ...@@ -647,7 +654,7 @@ IMPL_LINK_NOARG(LinePropertyPanel, ChangeLineStyleHdl)
GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_DASH, SfxCallMode::RECORD, &aItemB, 0L); GetBindings()->GetDispatcher()->Execute(SID_ATTR_LINE_DASH, SfxCallMode::RECORD, &aItemB, 0L);
} }
} }
ActivateControls();
return 0; return 0;
} }
...@@ -773,6 +780,43 @@ VclPtr<PopupControl> LinePropertyPanel::CreateLineWidthPopupControl (PopupContai ...@@ -773,6 +780,43 @@ VclPtr<PopupControl> LinePropertyPanel::CreateLineWidthPopupControl (PopupContai
return VclPtrInstance<LineWidthControl>(pParent, *this); return VclPtrInstance<LineWidthControl>(pParent, *this);
} }
void LinePropertyPanel::ActivateControls()
{
const sal_Int32 nPos(mpLBStyle->GetSelectEntryPos());
if( 0 == nPos )
{
mpFTWidth->Disable();
mpTBWidth->Disable();
mpFTColor->Disable();
mpLBColor->Disable();
mpFTTransparency->Disable();
mpMFTransparent->Disable();
mpFTArrow->Disable();
mpLBStart->Disable();
mpLBEnd->Disable();
mpFTEdgeStyle->Disable();
mpLBEdgeStyle->Disable();
mpFTCapStyle->Disable();
mpLBCapStyle->Disable();
}
else
{
mpFTWidth->Enable();
mpTBWidth->Enable();
mpFTColor->Enable();
mpLBColor->Enable();
mpFTTransparency->Enable();
mpMFTransparent->Enable();
mpFTArrow->Enable();
mpLBStart->Enable();
mpLBEnd->Enable();
mpFTEdgeStyle->Enable();
mpLBEdgeStyle->Enable();
mpFTCapStyle->Enable();
mpLBCapStyle->Enable();
}
}
void LinePropertyPanel::EndLineWidthPopupMode() void LinePropertyPanel::EndLineWidthPopupMode()
{ {
maLineWidthPopup.Hide(); maLineWidthPopup.Hide();
......
...@@ -95,6 +95,8 @@ private: ...@@ -95,6 +95,8 @@ private:
//ui controls //ui controls
VclPtr<FixedText> mpFTWidth; VclPtr<FixedText> mpFTWidth;
VclPtr<ToolBox> mpTBWidth; VclPtr<ToolBox> mpTBWidth;
VclPtr<FixedText> mpFTColor;
VclPtr<ListBox> mpLBColor;
VclPtr<FixedText> mpFTStyle; VclPtr<FixedText> mpFTStyle;
VclPtr<ListBox> mpLBStyle; VclPtr<ListBox> mpLBStyle;
VclPtr<FixedText> mpFTTransparency; VclPtr<FixedText> mpFTTransparency;
...@@ -150,6 +152,7 @@ private: ...@@ -150,6 +152,7 @@ private:
void FillLineStyleList(); void FillLineStyleList();
void SelectEndStyle(bool bStart); void SelectEndStyle(bool bStart);
void SelectLineStyle(); void SelectLineStyle();
void ActivateControls();
DECL_LINK(ChangeLineStyleHdl, void*); DECL_LINK(ChangeLineStyleHdl, void*);
DECL_LINK_TYPED(ToolboxWidthSelectHdl, ToolBox*, void); DECL_LINK_TYPED(ToolboxWidthSelectHdl, ToolBox*, void);
......
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