diff options
author | Rishabh Kumar <kris.kr296@gmail.com> | 2015-06-08 11:54:52 +0530 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2015-07-28 09:10:31 +0000 |
commit | 618fd9d91a87113a1fbb5f829bd0d61207ff78af (patch) | |
tree | 93e58a48c4269e81227054b6071d618b94ae7199 /svx/source | |
parent | 611d8ee6fe141f9af39c76a864b365d57776db10 (diff) |
Line Controls are disabled when none entry is checked
Change-Id: Ie0ece4ca4b463642ea7b45bd3e27338fa5d3b9b8
Reviewed-on: https://gerrit.libreoffice.org/16146
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Yousuf Philips <philipz85@hotmail.com>
Tested-by: Yousuf Philips <philipz85@hotmail.com>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/sidebar/line/LinePropertyPanel.cxx | 46 | ||||
-rw-r--r-- | svx/source/sidebar/line/LinePropertyPanel.hxx | 3 |
2 files changed, 48 insertions, 1 deletions
diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx index faa5477518c3..7890bcaa79ab 100644 --- a/svx/source/sidebar/line/LinePropertyPanel.cxx +++ b/svx/source/sidebar/line/LinePropertyPanel.cxx @@ -177,6 +177,8 @@ LinePropertyPanel::LinePropertyPanel( { get(mpFTWidth, "widthlabel"); get(mpTBWidth, "width"); + get(mpFTColor, "colorlabel"); + get(mpLBColor, "color"); get(mpFTStyle, "stylelabel"); get(mpLBStyle, "linestyle"); get(mpFTTransparency, "translabel"); @@ -201,6 +203,8 @@ void LinePropertyPanel::dispose() { mpFTWidth.clear(); mpTBWidth.clear(); + mpFTColor.clear(); + mpLBColor.clear(); mpFTStyle.clear(); mpLBStyle.clear(); mpFTTransparency.clear(); @@ -285,6 +289,8 @@ void LinePropertyPanel::Initialize() aLink = LINK( this, LinePropertyPanel, ChangeCapStyleHdl ); mpLBCapStyle->SetSelectHdl( aLink ); mpLBCapStyle->SetAccessibleName(OUString("Cap Style")); + + ActivateControls(); } VclPtr<vcl::Window> LinePropertyPanel::Create ( @@ -611,6 +617,7 @@ void LinePropertyPanel::NotifyItemUpdate( break; } } + ActivateControls(); } 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); } } - + ActivateControls(); return 0; } @@ -773,6 +780,43 @@ VclPtr<PopupControl> LinePropertyPanel::CreateLineWidthPopupControl (PopupContai 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() { maLineWidthPopup.Hide(); diff --git a/svx/source/sidebar/line/LinePropertyPanel.hxx b/svx/source/sidebar/line/LinePropertyPanel.hxx index 6ef96e14e9af..f86a205b837f 100644 --- a/svx/source/sidebar/line/LinePropertyPanel.hxx +++ b/svx/source/sidebar/line/LinePropertyPanel.hxx @@ -95,6 +95,8 @@ private: //ui controls VclPtr<FixedText> mpFTWidth; VclPtr<ToolBox> mpTBWidth; + VclPtr<FixedText> mpFTColor; + VclPtr<ListBox> mpLBColor; VclPtr<FixedText> mpFTStyle; VclPtr<ListBox> mpLBStyle; VclPtr<FixedText> mpFTTransparency; @@ -150,6 +152,7 @@ private: void FillLineStyleList(); void SelectEndStyle(bool bStart); void SelectLineStyle(); + void ActivateControls(); DECL_LINK(ChangeLineStyleHdl, void*); DECL_LINK_TYPED(ToolboxWidthSelectHdl, ToolBox*, void); |