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

Redesign of Hatch tab

1. New Hatch Listbox for presets.
2. Context menu for rename and delete.
3. Rearrangement of controls.
4. Remove Save and Load Buttons.

Change-Id: Iad2479bc418f7a257a410df7f11c23ed8dd7734c
Reviewed-on: https://gerrit.libreoffice.org/26869Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst f3ca5230
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <svx/tabarea.hxx> #include <svx/tabarea.hxx>
#include <svx/hexcolorcontrol.hxx> #include <svx/hexcolorcontrol.hxx>
#include <svx/SvxColorValueSet.hxx> #include <svx/SvxColorValueSet.hxx>
#include <svx/SvxPresetListBox.hxx>
class SdrModel; class SdrModel;
class SdrView; class SdrView;
...@@ -478,13 +479,10 @@ private: ...@@ -478,13 +479,10 @@ private:
VclPtr<ListBox> m_pLbLineType; VclPtr<ListBox> m_pLbLineType;
VclPtr<ColorLB> m_pLbLineColor; VclPtr<ColorLB> m_pLbLineColor;
VclPtr<ColorLB> m_pLbBackgroundColor; VclPtr<ColorLB> m_pLbBackgroundColor;
VclPtr<HatchingLB> m_pLbHatchings; VclPtr<SvxPresetListBox> m_pHatchLB;
VclPtr<SvxXRectPreview> m_pCtlPreview; VclPtr<SvxXRectPreview> m_pCtlPreview;
VclPtr<PushButton> m_pBtnAdd; VclPtr<PushButton> m_pBtnAdd;
VclPtr<PushButton> m_pBtnModify; VclPtr<PushButton> m_pBtnModify;
VclPtr<PushButton> m_pBtnDelete;
VclPtr<PushButton> m_pBtnLoad;
VclPtr<PushButton> m_pBtnSave;
const SfxItemSet& m_rOutAttrs; const SfxItemSet& m_rOutAttrs;
...@@ -505,7 +503,8 @@ private: ...@@ -505,7 +503,8 @@ private:
SfxMapUnit m_ePoolUnit; SfxMapUnit m_ePoolUnit;
DECL_LINK_TYPED( ChangeHatchHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ChangeHatchHdl, ValueSet*, void );
void ChangeHatchHdl_Impl();
DECL_LINK_TYPED( ModifiedEditHdl_Impl, Edit&, void ); DECL_LINK_TYPED( ModifiedEditHdl_Impl, Edit&, void );
DECL_LINK_TYPED( ModifiedListBoxHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ModifiedListBoxHdl_Impl, ListBox&, void );
DECL_LINK_TYPED( ModifiedBackgroundHdl_Impl, ListBox&, void ); DECL_LINK_TYPED( ModifiedBackgroundHdl_Impl, ListBox&, void );
...@@ -513,9 +512,8 @@ private: ...@@ -513,9 +512,8 @@ private:
void ModifiedHdl_Impl(void*); void ModifiedHdl_Impl(void*);
DECL_LINK_TYPED( ClickAddHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickAddHdl_Impl, Button*, void );
DECL_LINK_TYPED( ClickModifyHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickModifyHdl_Impl, Button*, void );
DECL_LINK_TYPED( ClickDeleteHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickRenameHdl_Impl, SvxPresetListBox*, void );
DECL_LINK_TYPED( ClickLoadHdl_Impl, Button*, void ); DECL_LINK_TYPED( ClickDeleteHdl_Impl, SvxPresetListBox*, void );
DECL_LINK_TYPED( ClickSaveHdl_Impl, Button*, void );
long CheckChanges_Impl(); long CheckChanges_Impl();
sal_Int32 SearchHatchList(const OUString& rHatchName); sal_Int32 SearchHatchList(const OUString& rHatchName);
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "paragrph.hrc" #include "paragrph.hrc"
#include <svx/dialogs.hrc> #include <svx/dialogs.hrc>
using namespace com::sun::star; using namespace com::sun::star;
SvxHatchTabPage::SvxHatchTabPage SvxHatchTabPage::SvxHatchTabPage
...@@ -73,19 +74,14 @@ SvxHatchTabPage::SvxHatchTabPage ...@@ -73,19 +74,14 @@ SvxHatchTabPage::SvxHatchTabPage
get(m_pLbLineType, "linetypelb"); get(m_pLbLineType, "linetypelb");
get(m_pLbLineColor, "linecolorlb"); get(m_pLbLineColor, "linecolorlb");
get(m_pLbBackgroundColor, "backgroundcolorlb"); get(m_pLbBackgroundColor, "backgroundcolorlb");
get(m_pLbHatchings, "hatchingslb"); get(m_pHatchLB , "hatchpresetlist");
Size aSize = getDrawListBoxOptimalSize(this); Size aSize = getDrawListBoxOptimalSize(this);
m_pLbHatchings->set_width_request(aSize.Width());
m_pLbHatchings->set_height_request(aSize.Height());
get(m_pCtlPreview, "previewctl"); get(m_pCtlPreview, "previewctl");
aSize = getDrawPreviewOptimalSize(this); aSize = getDrawPreviewOptimalSize(this);
m_pCtlPreview->set_width_request(aSize.Width()); m_pCtlPreview->set_width_request(aSize.Width());
m_pCtlPreview->set_height_request(aSize.Height()); m_pCtlPreview->set_height_request(aSize.Height());
get(m_pBtnAdd, "add"); get(m_pBtnAdd, "add");
get(m_pBtnModify, "modify"); get(m_pBtnModify, "modify");
get(m_pBtnDelete, "delete");
get(m_pBtnLoad, "load");
get(m_pBtnSave, "save");
// this page needs ExchangeSupport // this page needs ExchangeSupport
SetExchangeSupport(); SetExchangeSupport();
...@@ -108,15 +104,13 @@ SvxHatchTabPage::SvxHatchTabPage ...@@ -108,15 +104,13 @@ SvxHatchTabPage::SvxHatchTabPage
assert( pPool && "Where is the pool?" ); assert( pPool && "Where is the pool?" );
m_ePoolUnit = pPool->GetMetric( SID_ATTR_FILL_HATCH ); m_ePoolUnit = pPool->GetMetric( SID_ATTR_FILL_HATCH );
// setting the slider range
m_pSliderAngle->SetRange(Range(0,359));
// setting the output device // setting the output device
m_rXFSet.Put( m_aXFStyleItem ); m_rXFSet.Put( m_aXFStyleItem );
m_rXFSet.Put( m_aXHatchItem ); m_rXFSet.Put( m_aXHatchItem );
m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() ); m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
m_pHatchLB->SetSelectHdl( LINK( this, SvxHatchTabPage, ChangeHatchHdl ) );
m_pLbHatchings->SetSelectHdl( LINK( this, SvxHatchTabPage, ChangeHatchHdl_Impl ) ); m_pHatchLB->SetRenameHdl( LINK( this, SvxHatchTabPage, ClickRenameHdl_Impl ) );
m_pHatchLB->SetDeleteHdl( LINK( this, SvxHatchTabPage, ClickDeleteHdl_Impl ) );
Link<Edit&,void> aLink = LINK( this, SvxHatchTabPage, ModifiedEditHdl_Impl ); Link<Edit&,void> aLink = LINK( this, SvxHatchTabPage, ModifiedEditHdl_Impl );
Link<ListBox&,void> aLink2 = LINK( this, SvxHatchTabPage, ModifiedListBoxHdl_Impl ); Link<ListBox&,void> aLink2 = LINK( this, SvxHatchTabPage, ModifiedListBoxHdl_Impl );
...@@ -128,16 +122,10 @@ SvxHatchTabPage::SvxHatchTabPage ...@@ -128,16 +122,10 @@ SvxHatchTabPage::SvxHatchTabPage
m_pLbBackgroundColor->SetSelectHdl( LINK( this, SvxHatchTabPage, ModifiedBackgroundHdl_Impl ) ); m_pLbBackgroundColor->SetSelectHdl( LINK( this, SvxHatchTabPage, ModifiedBackgroundHdl_Impl ) );
m_pBtnAdd->SetClickHdl( LINK( this, SvxHatchTabPage, ClickAddHdl_Impl ) ); m_pBtnAdd->SetClickHdl( LINK( this, SvxHatchTabPage, ClickAddHdl_Impl ) );
m_pBtnModify->SetClickHdl( m_pBtnModify->SetClickHdl( LINK( this, SvxHatchTabPage, ClickModifyHdl_Impl ) );
LINK( this, SvxHatchTabPage, ClickModifyHdl_Impl ) );
m_pBtnDelete->SetClickHdl(
LINK( this, SvxHatchTabPage, ClickDeleteHdl_Impl ) );
m_pBtnLoad->SetClickHdl( LINK( this, SvxHatchTabPage, ClickLoadHdl_Impl ) );
m_pBtnSave->SetClickHdl( LINK( this, SvxHatchTabPage, ClickSaveHdl_Impl ) );
m_pCtlPreview->SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); m_pCtlPreview->SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
setPreviewsToSamePlace(pParent, this);
} }
SvxHatchTabPage::~SvxHatchTabPage() SvxHatchTabPage::~SvxHatchTabPage()
...@@ -153,13 +141,10 @@ void SvxHatchTabPage::dispose() ...@@ -153,13 +141,10 @@ void SvxHatchTabPage::dispose()
m_pLbLineType.clear(); m_pLbLineType.clear();
m_pLbLineColor.clear(); m_pLbLineColor.clear();
m_pLbBackgroundColor.clear(); m_pLbBackgroundColor.clear();
m_pLbHatchings.clear(); m_pHatchLB.clear();
m_pCtlPreview.clear(); m_pCtlPreview.clear();
m_pBtnAdd.clear(); m_pBtnAdd.clear();
m_pBtnModify.clear(); m_pBtnModify.clear();
m_pBtnDelete.clear();
m_pBtnLoad.clear();
m_pBtnSave.clear();
SvxTabPage::dispose(); SvxTabPage::dispose();
} }
...@@ -168,7 +153,7 @@ void SvxHatchTabPage::Construct() ...@@ -168,7 +153,7 @@ void SvxHatchTabPage::Construct()
{ {
m_pLbLineColor->Fill( m_pColorList ); m_pLbLineColor->Fill( m_pColorList );
m_pLbBackgroundColor->Fill( m_pColorList ); m_pLbBackgroundColor->Fill( m_pColorList );
m_pLbHatchings->Fill( m_pHatchingList ); m_pHatchLB->FillPresetListBox(*m_pHatchingList);
} }
...@@ -224,10 +209,10 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet ) ...@@ -224,10 +209,10 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
if( *m_pPageType == PT_HATCH && *m_pPos != LISTBOX_ENTRY_NOTFOUND ) if( *m_pPageType == PT_HATCH && *m_pPos != LISTBOX_ENTRY_NOTFOUND )
{ {
m_pLbHatchings->SelectEntryPos( *m_pPos ); m_pHatchLB->SelectItem( *m_pPos );
} }
// colors could have been deleted // colors could have been deleted
ChangeHatchHdl_Impl( *m_pLbHatchings ); ChangeHatchHdl_Impl();
*m_pPageType = PT_HATCH; *m_pPageType = PT_HATCH;
*m_pPos = LISTBOX_ENTRY_NOTFOUND; *m_pPos = LISTBOX_ENTRY_NOTFOUND;
...@@ -272,7 +257,7 @@ long SvxHatchTabPage::CheckChanges_Impl() ...@@ -272,7 +257,7 @@ long SvxHatchTabPage::CheckChanges_Impl()
m_pMtrAngle->IsValueChangedFromSaved() || m_pMtrAngle->IsValueChangedFromSaved() ||
m_pLbLineType->IsValueChangedFromSaved() || m_pLbLineType->IsValueChangedFromSaved() ||
m_pLbLineColor->IsValueChangedFromSaved() || m_pLbLineColor->IsValueChangedFromSaved() ||
m_pLbHatchings->IsValueChangedFromSaved() ) m_pHatchLB->IsValueChangedFromSaved() )
{ {
ResMgr& rMgr = CUI_MGR(); ResMgr& rMgr = CUI_MGR();
Image aWarningBoxImage = WarningBox::GetStandardImage(); Image aWarningBoxImage = WarningBox::GetStandardImage();
...@@ -307,9 +292,9 @@ long SvxHatchTabPage::CheckChanges_Impl() ...@@ -307,9 +292,9 @@ long SvxHatchTabPage::CheckChanges_Impl()
} }
} }
sal_Int32 nPos = m_pLbHatchings->GetSelectEntryPos(); sal_Int32 nPos = m_pHatchLB->GetSelectItemId();
if( nPos != LISTBOX_ENTRY_NOTFOUND ) if( nPos != 0 )
*m_pPos = nPos; *m_pPos = nPos - 1;
return 0L; return 0L;
} }
...@@ -340,11 +325,11 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet ) ...@@ -340,11 +325,11 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet )
std::unique_ptr<XHatch> pXHatch; std::unique_ptr<XHatch> pXHatch;
OUString aString; OUString aString;
sal_Int32 nPos = m_pLbHatchings->GetSelectEntryPos(); sal_Int32 nPos = m_pHatchLB->GetSelectItemId();
if( nPos != LISTBOX_ENTRY_NOTFOUND ) if( nPos != 0 )
{ {
pXHatch.reset(new XHatch( m_pHatchingList->GetHatch( nPos )->GetHatch() )); pXHatch.reset(new XHatch( m_pHatchingList->GetHatch( nPos - 1 )->GetHatch() ));
aString = m_pLbHatchings->GetSelectEntry(); aString = m_pHatchLB->GetItemText( m_pHatchLB->GetSelectItemId() );
} }
// gradient has been (unidentifiedly) passed // gradient has been (unidentifiedly) passed
else else
...@@ -379,21 +364,7 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet ) ...@@ -379,21 +364,7 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet )
void SvxHatchTabPage::Reset( const SfxItemSet* rSet ) void SvxHatchTabPage::Reset( const SfxItemSet* rSet )
{ {
ChangeHatchHdl_Impl( *m_pLbHatchings ); ChangeHatchHdl_Impl();
// determine button state
if( m_pHatchingList->Count() )
{
m_pBtnModify->Enable();
m_pBtnDelete->Enable();
m_pBtnSave->Enable();
}
else
{
m_pBtnModify->Disable();
m_pBtnDelete->Disable();
m_pBtnSave->Disable();
}
m_rXFSet.Put( static_cast<const XFillColorItem&>( rSet->Get(XATTR_FILLCOLOR)) ); m_rXFSet.Put( static_cast<const XFillColorItem&>( rSet->Get(XATTR_FILLCOLOR)) );
m_rXFSet.Put( static_cast<const XFillBackgroundItem&>(rSet->Get(XATTR_FILLBACKGROUND)) ); m_rXFSet.Put( static_cast<const XFillBackgroundItem&>(rSet->Get(XATTR_FILLBACKGROUND)) );
...@@ -450,13 +421,18 @@ void SvxHatchTabPage::ModifiedHdl_Impl( void* p ) ...@@ -450,13 +421,18 @@ void SvxHatchTabPage::ModifiedHdl_Impl( void* p )
m_pCtlPreview->Invalidate(); m_pCtlPreview->Invalidate();
} }
IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ChangeHatchHdl_Impl, ListBox&, void) IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ChangeHatchHdl, ValueSet*, void)
{
ChangeHatchHdl_Impl();
}
void SvxHatchTabPage::ChangeHatchHdl_Impl()
{ {
std::unique_ptr<XHatch> pHatch; std::unique_ptr<XHatch> pHatch;
int nPos = m_pLbHatchings->GetSelectEntryPos(); int nPos = m_pHatchLB->GetSelectItemId();
if( nPos != LISTBOX_ENTRY_NOTFOUND ) if( nPos != 0 )
pHatch.reset(new XHatch( m_pHatchingList->GetHatch( nPos )->GetHatch() )); pHatch.reset(new XHatch( m_pHatchingList->GetHatch( nPos - 1 )->GetHatch() ));
else else
{ {
const SfxPoolItem* pPoolItem = nullptr; const SfxPoolItem* pPoolItem = nullptr;
...@@ -470,10 +446,10 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ChangeHatchHdl_Impl, ListBox&, void) ...@@ -470,10 +446,10 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ChangeHatchHdl_Impl, ListBox&, void)
} }
if( !pHatch ) if( !pHatch )
{ {
m_pLbHatchings->SelectEntryPos( 0 ); m_pHatchLB->SelectItem( 1 );
nPos = m_pLbHatchings->GetSelectEntryPos(); nPos = m_pHatchLB->GetSelectItemId();
if( nPos != LISTBOX_ENTRY_NOTFOUND ) if( nPos != 0 )
pHatch.reset(new XHatch( m_pHatchingList->GetHatch( nPos )->GetHatch() )); pHatch.reset(new XHatch( m_pHatchingList->GetHatch( nPos - 1 )->GetHatch() ));
} }
} }
if( pHatch ) if( pHatch )
...@@ -506,7 +482,7 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ChangeHatchHdl_Impl, ListBox&, void) ...@@ -506,7 +482,7 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ChangeHatchHdl_Impl, ListBox&, void)
m_pLbLineType->SaveValue(); m_pLbLineType->SaveValue();
m_pLbLineColor->SaveValue(); m_pLbLineColor->SaveValue();
m_pLbBackgroundColor->SaveValue(); m_pLbBackgroundColor->SaveValue();
m_pLbHatchings->SaveValue(); m_pHatchLB->SaveValue();
} }
IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void) IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void)
...@@ -566,281 +542,115 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void) ...@@ -566,281 +542,115 @@ IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickAddHdl_Impl, Button*, void)
m_pHatchingList->Insert( pEntry, nCount ); m_pHatchingList->Insert( pEntry, nCount );
m_pLbHatchings->Append( *pEntry, m_pHatchingList->GetUiBitmap( nCount ) ); m_pHatchLB->Clear();
m_pHatchLB->FillPresetListBox( *m_pHatchingList );
m_pLbHatchings->SelectEntryPos( m_pLbHatchings->GetEntryCount() - 1 ); m_pHatchLB->SelectItem( nCount + 1 );
#ifdef _WIN32
// hack: #31355# W.P.
Rectangle aRect( m_pLbHatchings->GetPosPixel(), m_pLbHatchings->GetSizePixel() );
if( sal_True ) { // ??? overlapped with pDlg
// and srolling
Invalidate( aRect );
}
#endif
*m_pnHatchingListState |= ChangeType::MODIFIED; *m_pnHatchingListState |= ChangeType::MODIFIED;
ChangeHatchHdl_Impl( *m_pLbHatchings ); ChangeHatchHdl_Impl();
}
// determine button state
if( m_pHatchingList->Count() )
{
m_pBtnModify->Enable();
m_pBtnDelete->Enable();
m_pBtnSave->Enable();
} }
} }
IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickModifyHdl_Impl, Button*, void) IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickModifyHdl_Impl, Button*, void)
{ {
sal_Int32 nPos = m_pLbHatchings->GetSelectEntryPos(); sal_Int32 nPos = m_pHatchLB->GetSelectItemId();
if ( nPos != LISTBOX_ENTRY_NOTFOUND ) if( nPos != 0 )
{ {
OUString aDesc( CUI_RES( RID_SVXSTR_DESC_HATCH ) ); OUString aName( m_pHatchingList->GetHatch( nPos - 1 )->GetName() );
OUString aName( m_pHatchingList->GetHatch( nPos )->GetName() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
assert(pFact && "Dialog creation failed!");
std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
assert(pDlg && "Dialog creation failed!");
bool bLoop = true;
while( bLoop && pDlg->Execute() == RET_OK )
{
pDlg->GetName( aName );
sal_Int32 nHatchPos = SearchHatchList( aName );
bool bValidHatchName = (nHatchPos == nPos) || (nHatchPos == LISTBOX_ENTRY_NOTFOUND);
if( bValidHatchName )
{
bLoop = false;
XHatch aXHatch( m_pLbLineColor->GetSelectEntryColor(),
(css::drawing::HatchStyle) m_pLbLineType->GetSelectEntryPos(),
GetCoreValue( *m_pMtrDistance, m_ePoolUnit ),
static_cast<long>(m_pMtrAngle->GetValue() * 10) );
XHatchEntry* pEntry = new XHatchEntry( aXHatch, aName ); XHatch aXHatch( m_pLbLineColor->GetSelectEntryColor(),
(css::drawing::HatchStyle) m_pLbLineType->GetSelectEntryPos(),
GetCoreValue( *m_pMtrDistance, m_ePoolUnit ),
static_cast<long>(m_pMtrAngle->GetValue() * 10) );
delete m_pHatchingList->Replace( pEntry, nPos ); XHatchEntry* pEntry = new XHatchEntry( aXHatch, aName );
m_pLbHatchings->Modify( *pEntry, nPos, m_pHatchingList->GetUiBitmap( nPos ) ); delete m_pHatchingList->Replace( pEntry, nPos - 1 );
m_pLbHatchings->SelectEntryPos( nPos ); m_pHatchLB->Clear();
m_pHatchLB->FillPresetListBox( *m_pHatchingList );
m_pHatchLB->SelectItem( nPos );
// save values for changes recognition (-> method) // save values for changes recognition (-> method)
m_pMtrDistance->SaveValue(); m_pMtrDistance->SaveValue();
m_pMtrAngle->SaveValue(); m_pMtrAngle->SaveValue();
m_pLbLineType->SaveValue(); m_pLbLineType->SaveValue();
m_pLbLineColor->SaveValue(); m_pLbLineColor->SaveValue();
m_pLbBackgroundColor->SaveValue(); m_pLbBackgroundColor->SaveValue();
m_pLbHatchings->SaveValue();
*m_pnHatchingListState |= ChangeType::MODIFIED; *m_pnHatchingListState |= ChangeType::MODIFIED;
}
else
{
ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui" );
aBox->Execute();
}
}
} }
} }
IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, void)
IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickDeleteHdl_Impl, Button*, void)
{ {
sal_Int32 nPos = m_pLbHatchings->GetSelectEntryPos(); sal_Int32 nPos = m_pHatchLB->GetSelectItemId();
if( nPos != LISTBOX_ENTRY_NOTFOUND ) if( nPos != 0 )
{ {
ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelHatchDialog","cui/ui/querydeletehatchdialog.ui"); ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelHatchDialog","cui/ui/querydeletehatchdialog.ui");
if( aQueryBox->Execute() == RET_YES ) if( aQueryBox->Execute() == RET_YES )
{ {
delete m_pHatchingList->Remove( nPos ); m_pHatchingList->Remove( nPos - 1 );
m_pLbHatchings->RemoveEntry( nPos ); m_pHatchLB->RemoveItem( nPos );
m_pLbHatchings->SelectEntryPos( 0 ); m_pHatchLB->SelectItem( 1 );
m_pCtlPreview->Invalidate(); m_pCtlPreview->Invalidate();
ChangeHatchHdl_Impl( *m_pLbHatchings ); ChangeHatchHdl_Impl();
*m_pnHatchingListState |= ChangeType::MODIFIED; *m_pnHatchingListState |= ChangeType::MODIFIED;
} }
} }
// determine button state
if( !m_pHatchingList->Count() )
{
m_pBtnModify->Disable();
m_pBtnDelete->Disable();
m_pBtnSave->Disable();
}
} }
IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void )
IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickLoadHdl_Impl, Button*, void)
{ {
ResMgr& rMgr = CUI_MGR(); sal_Int32 nPos = m_pHatchLB->GetSelectItemId();
sal_uInt16 nReturn = RET_YES;
if ( *m_pnHatchingListState & ChangeType::MODIFIED )
{
nReturn = ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog()
,"AskSaveList"
,"cui/ui/querysavelistdialog.ui")->Execute();
if ( nReturn == RET_YES )
m_pHatchingList->Save();
}
if ( nReturn != RET_CANCEL ) if( nPos != 0 )
{ {
::sfx2::FileDialogHelper aDlg( css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE ); OUString aDesc( CUI_RES( RID_SVXSTR_DESC_HATCH ) );
OUString aStrFilterType( "*.soh" ); OUString aName( m_pHatchingList->GetHatch( nPos - 1 )->GetName() );
aDlg.AddFilter( aStrFilterType, aStrFilterType );
OUString aPalettePath(SvtPathOptions().GetPalettePath());
OUString aLastDir;
sal_Int32 nIndex = 0;
do
{
aLastDir = aPalettePath.getToken(0, ';', nIndex);
}
while (nIndex >= 0);
INetURLObject aFile(aLastDir); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) ); assert(pFact && "Dialog creation failed!");
std::unique_ptr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( GetParentDialog(), aName, aDesc ));
assert(pDlg && "Dialog creation failed!");
if( aDlg.Execute() == ERRCODE_NONE ) bool bLoop = true;
while( bLoop && pDlg->Execute() == RET_OK )
{ {
INetURLObject aURL( aDlg.GetPath() ); pDlg->GetName( aName );
INetURLObject aPathURL( aURL ); sal_Int32 nHatchPos = SearchHatchList( aName );
bool bValidHatchName = (nHatchPos == nPos - 1) || (nHatchPos == LISTBOX_ENTRY_NOTFOUND);
aPathURL.removeSegment();
aPathURL.removeFinalSlash();
XHatchListRef pHatchList = XPropertyList::AsHatchList( if(bValidHatchName)
XPropertyList::CreatePropertyList(
XHATCH_LIST, aPathURL.GetMainURL( INetURLObject::NO_DECODE ), "" ));
pHatchList->SetName( aURL.getName() );
if( pHatchList->Load() )
{ {
m_pHatchingList = pHatchList; bLoop = false;
static_cast<SvxAreaTabDialog*>( GetParentDialog() )->SetNewHatchingList( m_pHatchingList ); XHatchEntry* pEntry = m_pHatchingList->GetHatch( nPos - 1 );
pEntry->SetName( aName );
m_pLbHatchings->Clear();
m_pLbHatchings->Fill( m_pHatchingList );
Reset( &m_rOutAttrs );
m_pHatchingList->SetName( aURL.getName() );
// determining (and possibly cutting) the name
// and displaying it in the GroupBox
OUString aString( ResId( RID_SVXSTR_TABLE, rMgr ) );
aString += ": ";
if ( aURL.getBase().getLength() > 18 ) delete m_pHatchingList->Replace( pEntry, nPos - 1 );
{ m_pHatchLB->Clear();
aString += aURL.getBase().copy( 0, 15 ); m_pHatchLB->FillPresetListBox(*m_pHatchingList);
aString += "..."; m_pHatchLB->SelectItem( nPos );
}
else
aString += aURL.getBase();
*m_pnHatchingListState |= ChangeType::CHANGED; *m_pnHatchingListState |= ChangeType::MODIFIED;
*m_pnHatchingListState &= ~ChangeType::MODIFIED;
} }
else else
ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog()
,"NoLoadedFileDialog"
,"cui/ui/querynoloadedfiledialog.ui")->Execute();
}
}
// determine button state
if ( m_pHatchingList->Count() )
{
m_pBtnModify->Enable();
m_pBtnDelete->Enable();
m_pBtnSave->Enable();
}
else
{
m_pBtnModify->Disable();
m_pBtnDelete->Disable();
m_pBtnSave->Disable();
}
}
IMPL_LINK_NOARG_TYPED(SvxHatchTabPage, ClickSaveHdl_Impl, Button*, void)
{
::sfx2::FileDialogHelper aDlg( css::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE );
OUString aStrFilterType( "*.soh" );
aDlg.AddFilter( aStrFilterType, aStrFilterType );
OUString aPalettePath(SvtPathOptions().GetPalettePath());
OUString aLastDir;
sal_Int32 nIndex = 0;
do
{
aLastDir = aPalettePath.getToken(0, ';', nIndex);
}
while (nIndex >= 0);
INetURLObject aFile(aLastDir);
SAL_WARN_IF( aFile.GetProtocol() == INetProtocol::NotValid, "cui.tabpages", "invalid URL" );
if( !m_pHatchingList->GetName().isEmpty() )
{
aFile.Append( m_pHatchingList->GetName() );
if( aFile.getExtension().isEmpty() )
aFile.SetExtension( "soh" );
}
aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::NO_DECODE ) );
if ( aDlg.Execute() == ERRCODE_NONE )
{
INetURLObject aURL( aDlg.GetPath() );
INetURLObject aPathURL( aURL );
aPathURL.removeSegment();
aPathURL.removeFinalSlash();
m_pHatchingList->SetName( aURL.getName() );
m_pHatchingList->SetPath( aPathURL.GetMainURL( INetURLObject::NO_DECODE ) );
if( m_pHatchingList->Save() )
{
// determining (and possibly cutting) the name
// and displaying it in the GroupBox
OUString aString( CUI_RES( RID_SVXSTR_TABLE ) );
aString += ": ";
if ( aURL.getBase().getLength() > 18 )
{ {
aString += aURL.getBase().copy( 0, 15 ); ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog()
aString += "..."; ,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui" );
aBox->Execute();
} }
else
aString += aURL.getBase();
*m_pnHatchingListState |= ChangeType::SAVED;
*m_pnHatchingListState &= ~ChangeType::MODIFIED;
}
else
{
ScopedVclPtrInstance<MessageDialog>::Create( GetParentDialog()
,"NoSaveFileDialog"
,"cui/ui/querynosavefiledialog.ui")->Execute();
} }
} }
} }
void SvxHatchTabPage::PointChanged( vcl::Window*, RECT_POINT ) void SvxHatchTabPage::PointChanged( vcl::Window*, RECT_POINT )
......
...@@ -13,27 +13,111 @@ ...@@ -13,27 +13,111 @@
<property name="step_increment">1</property> <property name="step_increment">1</property>
</object> </object>
<object class="GtkAdjustment" id="distanceadjustment"> <object class="GtkAdjustment" id="distanceadjustment">
<property name="lower">0.3</property> <property name="lower">0.29999999999999999</property>
<property name="upper">99</property> <property name="upper">99</property>
<property name="step_increment">100</property> <property name="step_increment">100</property>
</object> </object>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">res/sc05501.png</property>
</object>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">res/sc05502.png</property>
</object>
<object class="GtkBox" id="HatchPage"> <object class="GtkBox" id="HatchPage">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="vexpand">True</property> <property name="vexpand">True</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="orientation">vertical</property> <property name="spacing">12</property>
<child>
<object class="GtkFrame" id="frame3">
<property name="visible">True</property>
<property name="can_focus">False</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="box5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="svxcorelo-SvxPresetListBox" id="hatchpresetlist">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButtonBox" id="buttonbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="spacing">6</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="add">
<property name="label">gtk-add</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="modify">
<property name="label" translatable="yes">_Modify</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
</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">False</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Hatch</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> <child>
<object class="GtkFrame" id="frame1"> <object class="GtkFrame" id="frame1">
<property name="visible">True</property> <property name="visible">True</property>
...@@ -58,404 +142,176 @@ ...@@ -58,404 +142,176 @@
<property name="vexpand">True</property> <property name="vexpand">True</property>
<property name="spacing">12</property> <property name="spacing">12</property>
<child> <child>
<object class="GtkGrid" id="maingrid"> <object class="GtkBox" id="box3">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="vexpand">True</property> <property name="orientation">vertical</property>
<property name="row_spacing">6</property> <property name="spacing">6</property>
<property name="column_spacing">12</property>
<child> <child>
<object class="GtkBox" id="box3"> <object class="GtkLabel" id="distanceft">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="xalign">0</property>
<property name="spacing">6</property> <property name="label" translatable="yes">_Spacing:</property>
<child> <property name="use_underline">True</property>
<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> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="expand">False</property>
<property name="top_attach">0</property> <property name="fill">True</property>
<property name="width">1</property> <property name="position">0</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="box6"> <object class="GtkSpinButton" id="distancemtr:0mm">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="orientation">vertical</property> <property name="invisible_char"></property>
<property name="spacing">6</property> <property name="adjustment">distanceadjustment</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> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="expand">False</property>
<property name="top_attach">1</property> <property name="fill">True</property>
<property name="width">1</property> <property name="position">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="box7"> <object class="GtkLabel" id="angleft">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="xalign">0</property>
<property name="spacing">6</property> <property name="label" translatable="yes">A_ngle:</property>
<child> <property name="use_underline">True</property>
<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> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="expand">False</property>
<property name="top_attach">2</property> <property name="fill">True</property>
<property name="width">1</property> <property name="position">2</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="box8"> <object class="GtkBox" id="box1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<object class="GtkLabel" id="linecolorft"> <object class="GtkScale" id="angleslider">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">0</property> <property name="hexpand">True</property>
<property name="label" translatable="yes">Line _color:</property> <property name="adjustment">adjustment1</property>
<property name="use_underline">True</property> <property name="round_digits">1</property>
<property name="draw_value">False</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="svxlo-ColorLB" id="linecolorlb"> <object class="GtkSpinButton" id="anglemtr:0degrees">
<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">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<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="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="xalign">0</property> <property name="invisible_char"></property>
<property name="label" translatable="yes">Background color:</property> <property name="adjustment">angleadjustment</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">False</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> <property name="position">1</property>
</packing> </packing>
</child> </child>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="expand">False</property>
<property name="top_attach">4</property> <property name="fill">True</property>
<property name="width">1</property> <property name="position">3</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="valign">start</property>
<property name="hexpand">True</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child> <child>
<object class="svxlo-HatchingLB" id="hatchingslb:border"> <object class="GtkLabel" id="linetypeft">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="entry_text_column">0</property> <property name="xalign">0</property>
<property name="id_column">1</property> <property name="label" translatable="yes">_Line type:</property>
<property name="use_underline">True</property>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="expand">False</property>
<property name="top_attach">0</property> <property name="fill">True</property>
<property name="width">1</property> <property name="position">4</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="svxlo-SvxXRectPreview" id="previewctl"> <object class="GtkComboBoxText" id="linetypelb">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="hexpand">True</property> <items>
<property name="vexpand">True</property> <item translatable="yes">Single</item>
<child internal-child="accessible"> <item translatable="yes">Crossed</item>
<object class="AtkObject" id="previewctl-atkobject"> <item translatable="yes">Triple</item>
<property name="AtkObject::accessible-name" translatable="yes">Example</property> </items>
</object>
</child>
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="expand">False</property>
<property name="top_attach">1</property> <property name="fill">True</property>
<property name="width">1</property> <property name="position">5</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButtonBox" id="buttonbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<property name="layout_style">start</property>
<child> <child>
<object class="GtkButton" id="add"> <object class="GtkLabel" id="linecolorft">
<property name="label">gtk-add</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">False</property>
<property name="receives_default">True</property> <property name="xalign">0</property>
<property name="use_stock">True</property> <property name="label" translatable="yes">Line _color:</property>
<property name="use_underline">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">6</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="modify"> <object class="svxlo-ColorLB" id="linecolorlb">
<property name="label" translatable="yes">_Modify</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">False</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">7</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="delete"> <object class="GtkLabel" id="backgroundcolorft">
<property name="label">gtk-delete</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">False</property>
<property name="receives_default">True</property> <property name="xalign">0</property>
<property name="use_stock">True</property> <property name="label" translatable="yes">Background color:</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">3</property> <property name="position">8</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkGrid" id="grid4"> <object class="svxlo-ColorLB" id="backgroundcolorlb">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkButton" id="load">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Load Hatching List</property>
<property name="tooltip_text" translatable="yes">Load Hatching List</property>
<property name="halign">center</property>
<property name="hexpand">True</property>
<property name="image">image1</property>
</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="GtkButton" id="save">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Save Hatching List</property>
<property name="tooltip_text" translatable="yes">Save Hatching List</property>
<property name="halign">center</property>
<property name="hexpand">True</property>
<property name="image">image2</property>
</object>
<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> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">5</property> <property name="position">9</property>
<property name="secondary">True</property>
</packing> </packing>
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">True</property>
<property name="position">2</property> <property name="position">0</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -466,7 +322,7 @@ ...@@ -466,7 +322,7 @@
<object class="GtkLabel" id="propfl"> <object class="GtkLabel" id="propfl">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">Properties</property> <property name="label" translatable="yes">Options</property>
<attributes> <attributes>
<attribute name="weight" value="bold"/> <attribute name="weight" value="bold"/>
</attributes> </attributes>
...@@ -476,7 +332,69 @@ ...@@ -476,7 +332,69 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frame2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="valign">start</property>
<property name="orientation">vertical</property>
<child>
<object class="svxlo-SvxXRectPreview" id="previewctl">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child internal-child="accessible">
<object class="AtkObject" id="previewctl-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Example</property>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Preview</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">2</property>
</packing> </packing>
</child> </child>
</object> </object>
......
...@@ -350,6 +350,7 @@ public: ...@@ -350,6 +350,7 @@ public:
} }
void SaveValue() { mnSavedItemId = GetSelectItemId(); } void SaveValue() { mnSavedItemId = GetSelectItemId(); }
sal_Int32 GetSavedValue() const { return mnSavedItemId; } sal_Int32 GetSavedValue() const { return mnSavedItemId; }
bool IsValueChangedFromSaved() { return mnSavedItemId != GetSelectItemId(); }
bool IsItemSelected( sal_uInt16 nItemId ) const bool IsItemSelected( sal_uInt16 nItemId ) const
{ {
return !mbNoSelection && (nItemId == mnSelItemId); return !mbNoSelection && (nItemId == mnSelItemId);
......
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