Addition of new controls and their rearrangement in hatch tab

1. Removal of rectangle hatch angle dial widget
2. Addition of slider widget for changing angle in hatch tab.
3. Move hatch background color control from area tab to hatch tab.
4. Rearrangement of controls
5. Removal of hatch controls from Area tab

Change-Id: I596098b328fc183d2fdd5259e90013dbf74d9ad7
Reviewed-on: https://gerrit.libreoffice.org/25147
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
This commit is contained in:
Rishabh Kumar 2016-05-19 13:54:04 +05:30 committed by Katarina Behrens
parent d1182223dc
commit 7a4bd998e9
5 changed files with 286 additions and 347 deletions

View file

@ -193,10 +193,6 @@ private:
VclPtr<BitmapLB> m_pLbBitmap;
VclPtr<SvxXRectPreview> m_pCtlBitmapPreview;
VclPtr<VclFrame> m_pFlHatchBckgrd;
VclPtr<CheckBox> m_pCbxHatchBckgrd;
VclPtr<ColorLB> m_pLbHatchBckgrdColor;
VclPtr<VclBox> m_pBxBitmap;
VclPtr<VclFrame> m_pFlSize;
@ -264,10 +260,8 @@ private:
DECL_LINK_TYPED(SelectDialogTypeHdl_Impl, ListBox&, void);
DECL_LINK_TYPED( ModifyColorHdl_Impl, ListBox&, void );
DECL_LINK_TYPED( ModifyHatchBckgrdColorHdl_Impl, ListBox&, void );
DECL_LINK_TYPED( ModifyGradientHdl_Impl, ListBox&, void );
DECL_LINK_TYPED( ModifyHatchingHdl_Impl, ListBox&, void );
DECL_LINK_TYPED( ToggleHatchBckgrdColorHdl_Impl, CheckBox&, void );
DECL_LINK_TYPED( ModifyBitmapHdl_Impl, ListBox&, void );
void ModifyStepCountHdl_Impl(void*);
@ -473,9 +467,10 @@ class SvxHatchTabPage : public SvxTabPage
private:
VclPtr<MetricField> m_pMtrDistance;
VclPtr<MetricField> m_pMtrAngle;
VclPtr<SvxRectCtl> m_pCtlAngle;
VclPtr<Slider> m_pSliderAngle;
VclPtr<ListBox> m_pLbLineType;
VclPtr<ColorLB> m_pLbLineColor;
VclPtr<ColorLB> m_pLbBackgroundColor;
VclPtr<HatchingLB> m_pLbHatchings;
VclPtr<SvxXRectPreview> m_pCtlPreview;
VclPtr<PushButton> m_pBtnAdd;
@ -506,6 +501,8 @@ private:
DECL_LINK_TYPED( ChangeHatchHdl_Impl, ListBox&, void );
DECL_LINK_TYPED( ModifiedEditHdl_Impl, Edit&, void );
DECL_LINK_TYPED( ModifiedListBoxHdl_Impl, ListBox&, void );
DECL_LINK_TYPED( ModifiedBackgroundHdl_Impl, ListBox&, void );
DECL_LINK_TYPED( ModifiedSliderHdl_Impl, Slider*, void );
void ModifiedHdl_Impl(void*);
DECL_LINK_TYPED( ClickAddHdl_Impl, Button*, void );
DECL_LINK_TYPED( ClickModifyHdl_Impl, Button*, void );

View file

@ -115,10 +115,6 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs
get(m_pLbBitmap,"LB_BITMAP");
get(m_pCtlBitmapPreview,"CTL_BITMAP_PREVIEW");
get(m_pFlHatchBckgrd,"FL_HATCHCOLORS");
get(m_pLbHatchBckgrdColor,"LB_HATCHBCKGRDCOLOR");
get(m_pCbxHatchBckgrd,"CB_HATCHBCKGRD");
get(m_pBxBitmap,"boxBITMAP");
get(m_pFlSize,"FL_SIZE");
@ -151,11 +147,8 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs
//size required for any of the areas which might be selected
//later, so that there's sufficient space
VclContainer *pMainFrame = get<VclContainer>("mainframe");
Size aHatchSize(m_pFlHatchBckgrd->get_preferred_size());
Size aBitmapSize(m_pBxBitmap->get_preferred_size());
Size aMainFrame(
std::max(aHatchSize.Width(), aBitmapSize.Width()),
std::max(aHatchSize.Height(), aBitmapSize.Height()));
Size aMainFrame(aBitmapSize.Width(),aBitmapSize.Height());
pMainFrame->set_width_request(aMainFrame.Width());
pMainFrame->set_height_request(aMainFrame.Height());
@ -166,9 +159,6 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs
m_pBxBitmap->Hide();
// Controls for Hatch-Background
m_pFlHatchBckgrd->Hide();
m_pTsbOriginal->EnableTriState( false );
// this page needs ExchangeSupport
@ -200,8 +190,6 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs
m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
m_pLbColor->SetSelectHdl( LINK( this, SvxAreaTabPage, ModifyColorHdl_Impl ) );
m_pLbHatchBckgrdColor->SetSelectHdl( LINK( this, SvxAreaTabPage, ModifyHatchBckgrdColorHdl_Impl ) );
m_pCbxHatchBckgrd->SetToggleHdl( LINK( this, SvxAreaTabPage, ToggleHatchBckgrdColorHdl_Impl ) );
//UUUU
m_pBtnImport->SetClickHdl(LINK(this, SvxAreaTabPage, ClickImportHdl_Impl));
@ -264,9 +252,6 @@ void SvxAreaTabPage::dispose()
m_pLbHatching.clear();
m_pLbBitmap.clear();
m_pCtlBitmapPreview.clear();
m_pFlHatchBckgrd.clear();
m_pCbxHatchBckgrd.clear();
m_pLbHatchBckgrdColor.clear();
m_pBxBitmap.clear();
m_pFlSize.clear();
m_pTsbOriginal.clear();
@ -298,8 +283,6 @@ void SvxAreaTabPage::Construct()
{
// fill colortables / lists
m_pLbColor->Fill( m_pColorList );
m_pLbHatchBckgrdColor->Fill ( m_pColorList );
m_pLbGradient->Fill( m_pGradientList );
m_pLbHatching->Fill( m_pHatchingList );
m_pLbBitmap->Fill( m_pBitmapList );
@ -341,7 +324,6 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
m_pLbBitmap->SelectEntryPos( 0 );
else
m_pLbBitmap->SelectEntryPos( _nPos );
ModifyBitmapHdl_Impl( *m_pLbBitmap );
}
if( *m_pnHatchingListState != ChangeType::NONE )
@ -361,8 +343,6 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
else
m_pLbHatching->SelectEntryPos( _nPos );
ModifyHatchingHdl_Impl( *m_pLbHatching );
ModifyHatchBckgrdColorHdl_Impl( *m_pLbHatchBckgrdColor );
}
if( *m_pnGradientListState != ChangeType::NONE )
@ -401,20 +381,6 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
m_pLbColor->SelectEntryPos( _nPos );
ModifyColorHdl_Impl( *m_pLbColor );
// Backgroundcolor of hatch
_nPos = m_pLbHatchBckgrdColor->GetSelectEntryPos();
m_pLbHatchBckgrdColor->Clear();
m_pLbHatchBckgrdColor->Fill( m_pColorList );
nCount = m_pLbHatchBckgrdColor->GetEntryCount();
if( nCount == 0 )
; // This case should never occur
else if( nCount <= _nPos )
m_pLbHatchBckgrdColor->SelectEntryPos( 0 );
else
m_pLbHatchBckgrdColor->SelectEntryPos( _nPos );
ModifyHatchBckgrdColorHdl_Impl( *m_pLbHatchBckgrdColor );
}
// evaluate if any other Tabpage set another filltype
@ -443,7 +409,6 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
case PT_COLOR:
m_pTypeLB->SelectEntryPos( drawing::FillStyle_SOLID );
m_pLbColor->SelectEntryPos( _nPos );
m_pLbHatchBckgrdColor->SelectEntryPos( _nPos );
ClickColorHdl_Impl();
break;
}
@ -609,21 +574,6 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
bModified = true;
}
}
XFillBackgroundItem aItem ( m_pCbxHatchBckgrd->IsChecked() );
rAttrs->Put( aItem );
m_nPos = m_pLbHatchBckgrdColor->GetSelectEntryPos();
if( m_nPos != LISTBOX_ENTRY_NOTFOUND &&
m_pLbHatchBckgrdColor->IsValueChangedFromSaved() )
{
XFillColorItem aFillColorItem( m_pLbHatchBckgrdColor->GetSelectEntry(),
m_pLbHatchBckgrdColor->GetSelectEntryColor() );
pOld = GetOldItem( *rAttrs, XATTR_FILLCOLOR );
if ( !pOld || !( *static_cast<const XFillColorItem*>(pOld) == aFillColorItem ) )
{
rAttrs->Put( aFillColorItem );
bModified = true;
}
}
// NEW
if( (eSavedStyle != eStyle) &&
( bModified ||
@ -933,7 +883,6 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
XFillColorItem const& rColorItem(static_cast<const XFillColorItem&>(
rAttrs->Get(XATTR_FILLCOLOR)) );
m_pLbColor->SelectEntry( rColorItem.GetColorValue() );
m_pLbHatchBckgrdColor->SelectEntry( rColorItem.GetColorValue() );
}
SfxItemState const eGradState(rAttrs->GetItemState(XATTR_FILLGRADIENT));
@ -969,11 +918,6 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
m_pLbHatching->SelectEntryPos(0); // anything better than nothing
isMissingHatching = true;
}
if (SfxItemState::DONTCARE != rAttrs->GetItemState(XATTR_FILLBACKGROUND))
{
m_pCbxHatchBckgrd->Check( static_cast<const XFillBackgroundItem&>(
rAttrs->Get(XATTR_FILLBACKGROUND)).GetValue() );
}
SfxItemState const eBitmapState(rAttrs->GetItemState(XATTR_FILLBITMAP));
XFillBitmapItem const* pBitmapItem(nullptr);
@ -1007,7 +951,6 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
case drawing::FillStyle_HATCH:
ClickHatchingHdl_Impl();
ToggleHatchBckgrdColorHdl_Impl( *m_pCbxHatchBckgrd );
break;
case drawing::FillStyle_BITMAP:
@ -1205,7 +1148,6 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
m_pLbGradient->SaveValue();
if (!isMissingHatching)
m_pLbHatching->SaveValue();
m_pLbHatchBckgrdColor->SaveValue();
if (!isMissingBitmap)
m_pLbBitmap->SaveValue();
m_pTsbTile->SaveValue();
@ -1226,7 +1168,6 @@ void SvxAreaTabPage::ChangesApplied()
m_pLbColor->SaveValue();
m_pLbGradient->SaveValue();
m_pLbHatching->SaveValue();
m_pLbHatchBckgrdColor->SaveValue();
m_pLbBitmap->SaveValue();
m_pTsbTile->SaveValue();
m_pTsbStretch->SaveValue();
@ -1268,9 +1209,6 @@ void SvxAreaTabPage::ClickInvisibleHdl_Impl()
m_pCtlXRectPreview->Hide();
m_pCtlBitmapPreview->Hide();
// Controls for Hatch-Background
m_pFlHatchBckgrd->Hide();
m_rXFSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
m_pCtlXRectPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
@ -1294,9 +1232,6 @@ void SvxAreaTabPage::ClickColorHdl_Impl()
m_pCtlXRectPreview->Show();
m_pCtlBitmapPreview->Hide();
// Controls for Hatch-Background
m_pFlHatchBckgrd->Hide();
ModifyColorHdl_Impl( *m_pLbColor );
}
@ -1305,7 +1240,6 @@ IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyColorHdl_Impl, ListBox&, void)
{
const SfxPoolItem* pPoolItem = nullptr;
sal_Int32 _nPos = m_pLbColor->GetSelectEntryPos();
m_pLbHatchBckgrdColor->SelectEntryPos( _nPos );
if( _nPos != LISTBOX_ENTRY_NOTFOUND )
{
m_rXFSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) );
@ -1340,9 +1274,6 @@ void SvxAreaTabPage::ClickGradientHdl_Impl()
m_pCtlXRectPreview->Show();
m_pCtlBitmapPreview->Hide();
// Controls for Hatch-Background
m_pFlHatchBckgrd->Hide();
ModifyGradientHdl_Impl( *m_pLbGradient );
}
@ -1391,19 +1322,12 @@ void SvxAreaTabPage::ClickHatchingHdl_Impl()
m_pBxBitmap->Hide();
// Controls for Hatch-Background
m_pFlHatchBckgrd->Show();
m_pCbxHatchBckgrd->Enable();
m_pLbHatchBckgrdColor->Enable();
ModifyHatchingHdl_Impl( *m_pLbHatching );
ModifyHatchBckgrdColorHdl_Impl( *m_pLbHatchBckgrdColor );
ToggleHatchBckgrdColorHdl_Impl( *m_pCbxHatchBckgrd );
}
IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyHatchingHdl_Impl, ListBox&, void)
{
// fill Hatch ItemSet
const SfxPoolItem* pPoolItem = nullptr;
sal_Int32 _nPos = m_pLbHatching->GetSelectEntryPos();
if( _nPos != LISTBOX_ENTRY_NOTFOUND )
@ -1422,54 +1346,23 @@ IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyHatchingHdl_Impl, ListBox&, void)
else
m_rXFSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
m_pCtlXRectPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
m_pCtlXRectPreview->Invalidate();
}
IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ModifyHatchBckgrdColorHdl_Impl, ListBox&, void)
{
const SfxPoolItem* pPoolItem = nullptr;
sal_Int32 _nPos = m_pLbHatchBckgrdColor->GetSelectEntryPos();
m_pLbColor->SelectEntryPos( _nPos );
if( _nPos != LISTBOX_ENTRY_NOTFOUND )
// fill Hatch background ItemSet
XFillBackgroundItem aItem(static_cast<const XFillBackgroundItem&>(m_rOutAttrs.Get( XATTR_FILLBACKGROUND )));
m_rXFSet.Put( aItem, XATTR_FILLBACKGROUND );
if(aItem.GetValue())
{
m_rXFSet.Put( XFillColorItem( OUString(), m_pLbHatchBckgrdColor->GetSelectEntryColor() ) );
}
else if( SfxItemState::SET == m_rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), true, &pPoolItem ) )
{
Color aColor( static_cast<const XFillColorItem*>( pPoolItem )->GetColorValue() );
m_rXFSet.Put( XFillColorItem( OUString(), aColor ) );
}
else
m_rXFSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
m_pCtlXRectPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
m_pCtlXRectPreview->Invalidate();
}
IMPL_LINK_NOARG_TYPED(SvxAreaTabPage, ToggleHatchBckgrdColorHdl_Impl, CheckBox&, void)
{
// switch on/off backgroundcolor for hatches
m_pLbHatchBckgrdColor->Enable( m_pCbxHatchBckgrd->IsChecked() );
XFillBackgroundItem aItem( m_pCbxHatchBckgrd->IsChecked() );
m_rXFSet.Put ( aItem, XATTR_FILLBACKGROUND );
m_pCtlXRectPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
m_pCtlXRectPreview->Invalidate();
if( m_pLbHatchBckgrdColor->GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND )
{
if ( SfxItemState::SET == m_rOutAttrs.GetItemState( XATTR_FILLCOLOR ) )//>= SfxItemState::DEFAULT )
if( SfxItemState::SET == m_rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), true, &pPoolItem ) )
{
XFillColorItem aColorItem( static_cast<const XFillColorItem&>(m_rOutAttrs.Get( XATTR_FILLCOLOR )) );
m_pLbHatchBckgrdColor->SelectEntry( aColorItem.GetColorValue() );
Color aColor( static_cast<const XFillColorItem*>( pPoolItem )->GetColorValue() );
m_rXFSet.Put( XFillColorItem( OUString(), aColor ) );
}
else
m_rXFSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
}
}
m_pCtlXRectPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
m_pCtlXRectPreview->Invalidate();
}
void SvxAreaTabPage::ClickBitmapHdl_Impl()
{
@ -1505,9 +1398,6 @@ void SvxAreaTabPage::ClickBitmapHdl_Impl()
if (!m_pRbtRow->IsChecked() && !m_pRbtColumn->IsChecked())
m_pRbtRow->Check();
// Controls for Hatch-Background
m_pFlHatchBckgrd->Hide();
m_pBxBitmap->Show();
ModifyBitmapHdl_Impl( *m_pLbBitmap );

View file

@ -54,7 +54,6 @@ SvxHatchTabPage::SvxHatchTabPage
SvxTabPage ( pParent, "HatchPage", "cui/ui/hatchpage.ui", rInAttrs ),
m_rOutAttrs ( rInAttrs ),
m_pnHatchingListState ( nullptr ),
m_pnColorListState ( nullptr ),
m_pPageType ( nullptr ),
@ -70,10 +69,10 @@ SvxHatchTabPage::SvxHatchTabPage
{
get(m_pMtrDistance, "distancemtr");
get(m_pMtrAngle, "anglemtr");
get(m_pCtlAngle, "anglectl");
m_pCtlAngle->SetCS(CS_ANGLE);
get(m_pSliderAngle, "angleslider");
get(m_pLbLineType, "linetypelb");
get(m_pLbLineColor, "linecolorlb");
get(m_pLbBackgroundColor, "backgroundcolorlb");
get(m_pLbHatchings, "hatchingslb");
Size aSize = getDrawListBoxOptimalSize(this);
m_pLbHatchings->set_width_request(aSize.Width());
@ -109,6 +108,9 @@ SvxHatchTabPage::SvxHatchTabPage
DBG_ASSERT( pPool, "Wo ist der Pool?" );
m_ePoolUnit = pPool->GetMetric( SID_ATTR_FILL_HATCH );
// setting the slider range
m_pSliderAngle->SetRange(Range(0,359));
// setting the output device
m_rXFSet.Put( m_aXFStyleItem );
m_rXFSet.Put( m_aXHatchItem );
@ -120,8 +122,10 @@ SvxHatchTabPage::SvxHatchTabPage
Link<ListBox&,void> aLink2 = LINK( this, SvxHatchTabPage, ModifiedListBoxHdl_Impl );
m_pMtrDistance->SetModifyHdl( aLink );
m_pMtrAngle->SetModifyHdl( aLink );
m_pSliderAngle->SetSlideHdl( LINK( this, SvxHatchTabPage, ModifiedSliderHdl_Impl ) );
m_pLbLineType->SetSelectHdl( aLink2 );
m_pLbLineColor->SetSelectHdl( aLink2 );
m_pLbBackgroundColor->SetSelectHdl( LINK( this, SvxHatchTabPage, ModifiedBackgroundHdl_Impl ) );
m_pBtnAdd->SetClickHdl( LINK( this, SvxHatchTabPage, ClickAddHdl_Impl ) );
m_pBtnModify->SetClickHdl(
@ -145,9 +149,10 @@ void SvxHatchTabPage::dispose()
{
m_pMtrDistance.clear();
m_pMtrAngle.clear();
m_pCtlAngle.clear();
m_pSliderAngle.clear();
m_pLbLineType.clear();
m_pLbLineColor.clear();
m_pLbBackgroundColor.clear();
m_pLbHatchings.clear();
m_pCtlPreview.clear();
m_pBtnAdd.clear();
@ -162,6 +167,7 @@ void SvxHatchTabPage::dispose()
void SvxHatchTabPage::Construct()
{
m_pLbLineColor->Fill( m_pColorList );
m_pLbBackgroundColor->Fill( m_pColorList );
m_pLbHatchings->Fill( m_pHatchingList );
}
@ -228,8 +234,15 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
}
}
m_rXFSet.Put( static_cast<const XFillColorItem&>( rSet.Get(XATTR_FILLCOLOR)) );
m_rXFSet.Put( static_cast<const XFillBackgroundItem&>(rSet.Get(XATTR_FILLBACKGROUND)) );
XFillBackgroundItem aBckItem( static_cast<const XFillBackgroundItem&>(rSet.Get(XATTR_FILLBACKGROUND)));
XFillColorItem aColorItem( static_cast<const XFillColorItem&>(rSet.Get(XATTR_FILLCOLOR)) );
Color aColor(COL_WHITE);
if(aBckItem.GetValue())
aColor = aColorItem.GetColorValue();
m_pLbBackgroundColor->SelectEntry(aColor);
m_rXFSet.Put( aBckItem );
m_rXFSet.Put( aColorItem );
m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
m_pCtlPreview->Invalidate();
}
@ -322,6 +335,19 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet )
DBG_ASSERT( pXHatch, "XHatch konnte nicht erzeugt werden" );
rSet->Put( XFillStyleItem( drawing::FillStyle_HATCH ) );
rSet->Put( XFillHatchItem( aString, *pXHatch ) );
sal_uInt32 nPosBckColor = m_pLbBackgroundColor->GetSelectEntryPos();
XFillBackgroundItem aItem( m_pLbBackgroundColor->GetSelectEntryColor() != COL_WHITE );
rSet->Put( aItem , XATTR_FILLBACKGROUND );
if(aItem.GetValue())
{
OUString aBckColorString;
if( nPosBckColor != LISTBOX_ENTRY_NOTFOUND )
aBckColorString = m_pLbBackgroundColor->GetSelectEntry();
else
aBckColorString = OUString();
rSet->Put( XFillColorItem( aBckColorString, m_pLbBackgroundColor->GetSelectEntryColor() ) );
}
}
}
return true;
@ -364,27 +390,25 @@ IMPL_LINK_TYPED( SvxHatchTabPage, ModifiedListBoxHdl_Impl, ListBox&, rListBox, v
{
ModifiedHdl_Impl(&rListBox);
}
IMPL_LINK_TYPED( SvxHatchTabPage, ModifiedBackgroundHdl_Impl, ListBox&, rListBox, void )
{
ModifiedHdl_Impl(&rListBox);
}
IMPL_LINK_TYPED( SvxHatchTabPage, ModifiedEditHdl_Impl, Edit&, rEdit, void )
{
ModifiedHdl_Impl(&rEdit);
}
IMPL_LINK_TYPED( SvxHatchTabPage, ModifiedSliderHdl_Impl, Slider*, rSlider, void )
{
ModifiedHdl_Impl(rSlider);
}
void SvxHatchTabPage::ModifiedHdl_Impl( void* p )
{
if( p == m_pMtrAngle )
{
switch( m_pMtrAngle->GetValue() )
{
case 135: m_pCtlAngle->SetActualRP( RP_LT ); break;
case 90: m_pCtlAngle->SetActualRP( RP_MT ); break;
case 45: m_pCtlAngle->SetActualRP( RP_RT ); break;
case 180: m_pCtlAngle->SetActualRP( RP_LM ); break;
case 0: m_pCtlAngle->SetActualRP( RP_RM ); break;
case 225: m_pCtlAngle->SetActualRP( RP_LB ); break;
case 270: m_pCtlAngle->SetActualRP( RP_MB ); break;
case 315: m_pCtlAngle->SetActualRP( RP_RB ); break;
default: m_pCtlAngle->SetActualRP( RP_MM ); break;
}
}
m_pSliderAngle->SetThumbPos( m_pMtrAngle->GetValue() );
if( p == m_pSliderAngle )
m_pMtrAngle->SetValue( m_pSliderAngle->GetThumbPos() );
XHatch aXHatch( m_pLbLineColor->GetSelectEntryColor(),
(css::drawing::HatchStyle) m_pLbLineType->GetSelectEntryPos(),
@ -392,12 +416,16 @@ void SvxHatchTabPage::ModifiedHdl_Impl( void* p )
static_cast<long>(m_pMtrAngle->GetValue() * 10) );
m_rXFSet.Put( XFillHatchItem( OUString(), aXHatch ) );
XFillBackgroundItem aItem( m_pLbBackgroundColor->GetSelectEntryColor() != COL_WHITE );
m_rXFSet.Put( aItem, XATTR_FILLBACKGROUND );
if(aItem.GetValue())
m_rXFSet.Put( XFillColorItem( OUString(), m_pLbBackgroundColor->GetSelectEntryColor() ) );
m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
m_pCtlPreview->Invalidate();
}
IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ChangeHatchHdl_Impl, ListBox&, void)
{
std::unique_ptr<XHatch> pHatch;
@ -438,20 +466,9 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ChangeHatchHdl_Impl, ListBox&, void)
m_pLbLineColor->SelectEntry( pHatch->GetColor() );
}
SetMetricValue( *m_pMtrDistance, pHatch->GetDistance(), m_ePoolUnit );
m_pMtrAngle->SetValue( pHatch->GetAngle() / 10 );
switch( m_pMtrAngle->GetValue() )
{
case 135: m_pCtlAngle->SetActualRP( RP_LT ); break;
case 90: m_pCtlAngle->SetActualRP( RP_MT ); break;
case 45: m_pCtlAngle->SetActualRP( RP_RT ); break;
case 180: m_pCtlAngle->SetActualRP( RP_LM ); break;
case 0: m_pCtlAngle->SetActualRP( RP_RM ); break;
case 225: m_pCtlAngle->SetActualRP( RP_LB ); break;
case 270: m_pCtlAngle->SetActualRP( RP_MB ); break;
case 315: m_pCtlAngle->SetActualRP( RP_RB ); break;
default: m_pCtlAngle->SetActualRP( RP_MM ); break;
}
long mHatchAngle = pHatch->GetAngle() / 10;
m_pMtrAngle->SetValue( mHatchAngle );
m_pSliderAngle->SetThumbPos( mHatchAngle );
// fill ItemSet and pass it on to m_pCtlPreview
m_rXFSet.Put( XFillHatchItem( OUString(), *pHatch ) );
@ -464,10 +481,10 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ChangeHatchHdl_Impl, ListBox&, void)
m_pMtrAngle->SaveValue();
m_pLbLineType->SaveValue();
m_pLbLineColor->SaveValue();
m_pLbBackgroundColor->SaveValue();
m_pLbHatchings->SaveValue();
}
IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void)
{
OUString aNewName( SVX_RES( RID_SVXSTR_HATCH ) );
@ -613,6 +630,7 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickModifyHdl_Impl, Button*, void)
m_pMtrAngle->SaveValue();
m_pLbLineType->SaveValue();
m_pLbLineColor->SaveValue();
m_pLbBackgroundColor->SaveValue();
m_pLbHatchings->SaveValue();
*m_pnHatchingListState |= ChangeType::MODIFIED;
@ -819,28 +837,10 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickSaveHdl_Impl, Button*, void)
}
}
void SvxHatchTabPage::PointChanged( vcl::Window* pWindow, RECT_POINT eRcPt )
void SvxHatchTabPage::PointChanged( vcl::Window*, RECT_POINT )
{
if( pWindow == m_pCtlAngle )
{
switch( eRcPt )
{
case RP_LT: m_pMtrAngle->SetValue( 135 ); break;
case RP_MT: m_pMtrAngle->SetValue( 90 ); break;
case RP_RT: m_pMtrAngle->SetValue( 45 ); break;
case RP_LM: m_pMtrAngle->SetValue( 180 ); break;
case RP_RM: m_pMtrAngle->SetValue( 0 ); break;
case RP_LB: m_pMtrAngle->SetValue( 225 ); break;
case RP_MB: m_pMtrAngle->SetValue( 270 ); break;
case RP_RB: m_pMtrAngle->SetValue( 315 ); break;
case RP_MM: break;
}
ModifiedHdl_Impl( this );
}
}
void SvxHatchTabPage::DataChanged( const DataChangedEvent& rDCEvt )
{
if ( ( rDCEvt.GetType() == DataChangedEventType::SETTINGS ) && ( rDCEvt.GetFlags() & AllSettingsFlags::STYLE ) )

View file

@ -219,82 +219,6 @@
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkFrame" id="FL_HATCHCOLORS">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkCheckButton" id="CB_HATCHBCKGRD">
<property name="label" translatable="yes">_Background color</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="svxlo-ColorLB" id="LB_HATCHBCKGRDCOLOR">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Colors</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</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="boxBITMAP">
<property name="visible">True</property>
@ -784,7 +708,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">0</property>
</packing>
</child>
</object>

View file

@ -1,14 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<requires lib="LibreOffice" version="1.0"/>
<object class="GtkAdjustment" id="angleadjustment">
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">359</property>
<property name="step_increment">15</property>
<property name="page_increment">15</property>
</object>
<object class="GtkAdjustment" id="angleadjustment">
<property name="upper">359</property>
<property name="step_increment">1</property>
</object>
<object class="GtkAdjustment" id="distanceadjustment">
<property name="lower">0.29999999999999999</property>
<property name="lower">0.3</property>
<property name="upper">99</property>
<property name="step_increment">100</property>
</object>
@ -60,119 +65,234 @@
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="distanceft">
<object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Spacing:</property>
<property name="use_underline">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="distanceft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Spacing:</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="GtkSpinButton" id="distancemtr:0mm">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="adjustment">distanceadjustment</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">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="angleft">
<object class="GtkBox" id="box6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">A_ngle:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">anglemtr:0degrees</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="angleft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">A_ngle:</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="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkScale" id="angleslider">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="adjustment">adjustment1</property>
<property name="round_digits">1</property>
<property name="draw_value">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="anglemtr:0degrees">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="adjustment">angleadjustment</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</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="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="GtkLabel" id="linetypeft">
<object class="GtkBox" id="box7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Line type:</property>
<property name="use_underline">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="linetypeft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Line type:</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="GtkComboBoxText" id="linetypelb">
<property name="visible">True</property>
<property name="can_focus">False</property>
<items>
<item translatable="yes">Single</item>
<item translatable="yes">Crossed</item>
<item translatable="yes">Triple</item>
</items>
</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">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="linecolorft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Line _color:</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="distancemtr:0mm">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="adjustment">distanceadjustment</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="linetypelb">
<property name="visible">True</property>
<property name="can_focus">False</property>
<items>
<item translatable="yes">Single</item>
<item translatable="yes">Crossed</item>
<item translatable="yes">Triple</item>
</items>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="svxlo-ColorLB" id="linecolorlb">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="svxlo-SvxRectCtl" id="anglectl">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="anglemtr:0degrees">
<object class="GtkBox" id="box8">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="adjustment">angleadjustment</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="linecolorft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Line _color:</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="svxlo-ColorLB" id="linecolorlb">
<property name="visible">True</property>
<property name="can_focus">False</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="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<placeholder/>
<object class="GtkBox" id="box9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="backgroundcolorft">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Background color:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="svxlo-ColorLB" id="backgroundcolorlb">
<property name="visible">True</property>
<property name="can_focus">False</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">0</property>
<property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
@ -200,6 +320,8 @@
<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>
@ -217,6 +339,8 @@
<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>
</object>
@ -296,6 +420,8 @@
<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>
@ -313,6 +439,8 @@
<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>
</object>