summaryrefslogtreecommitdiff
path: root/cui/source/options
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-02-08 16:48:34 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-02-11 09:26:36 +0000
commit705b60f94ea5721662811501594d13d1ad925eb3 (patch)
tree323e54a39090487778bce0a37ac736275b07c7b6 /cui/source/options
parent4c5e4c47dec8dc9741e1f5c401b8d23f0cfc8e03 (diff)
move paths option page .ui to cui and adapt code
Change-Id: I60063a0d101ef47271194e45ee59f9ff622a4f1c
Diffstat (limited to 'cui/source/options')
-rw-r--r--cui/source/options/dbregister.cxx65
-rw-r--r--cui/source/options/optHeaderTabListbox.cxx5
-rw-r--r--cui/source/options/optHeaderTabListbox.hxx6
-rw-r--r--cui/source/options/optpath.cxx150
-rw-r--r--cui/source/options/optpath.hrc33
-rw-r--r--cui/source/options/optpath.src66
6 files changed, 111 insertions, 214 deletions
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index e6917f239670..dfa2def97a82 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -113,7 +113,6 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const Sfx
m_aNew ( this, CUI_RES( BTN_NEW ) ),
m_aEdit ( this, CUI_RES( BTN_EDIT ) ),
m_aDelete ( this, CUI_RES( BTN_DELETE ) ),
- pHeaderBar ( NULL ),
pPathBox ( NULL ),
m_pCurEntry ( NULL ),
m_nOldCount ( 0 ),
@@ -127,41 +126,38 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const Sfx
WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
- pPathBox = new ::svx::OptHeaderTabListBox( &aPathCtrl, nBits );
+ pPathBox = new ::svx::OptHeaderTabListBox( aPathCtrl, nBits );
- pHeaderBar = new HeaderBar( &aPathCtrl, WB_BUTTONSTYLE | WB_BOTTOMBORDER );
- pHeaderBar->SetPosSizePixel( Point( 0, 0 ), Size( aBoxSize.Width(), 16 ) );
- pHeaderBar->SetSelectHdl( LINK( this, DbRegistrationOptionsPage, HeaderSelect_Impl ) );
- pHeaderBar->SetEndDragHdl( LINK( this, DbRegistrationOptionsPage, HeaderEndDrag_Impl ) );
+ HeaderBar &rBar = pPathBox->GetTheHeaderBar();
+
+ rBar.SetSelectHdl( LINK( this, DbRegistrationOptionsPage, HeaderSelect_Impl ) );
+ rBar.SetEndDragHdl( LINK( this, DbRegistrationOptionsPage, HeaderEndDrag_Impl ) );
Size aSz;
aSz.Width() = TAB_WIDTH1;
- pHeaderBar->InsertItem( ITEMID_TYPE, aTypeText.GetText(),
+ rBar.InsertItem( ITEMID_TYPE, aTypeText.GetText(),
LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_UPARROW );
aSz.Width() = TAB_WIDTH2;
- pHeaderBar->InsertItem( ITEMID_PATH, aPathText.GetText(),
+ rBar.InsertItem( ITEMID_PATH, aPathText.GetText(),
LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
HIB_LEFT | HIB_VCENTER );
- static long nTabs[] = {3, 0, TAB_WIDTH1, TAB_WIDTH1 + TAB_WIDTH2 };
- Size aHeadSize = pHeaderBar->GetSizePixel();
+ static long aTabs[] = {3, 0, TAB_WIDTH1, TAB_WIDTH1 + TAB_WIDTH2 };
+ Size aHeadSize = rBar.GetSizePixel();
- aPathCtrl.SetFocusControl( pPathBox );
pPathBox->SetStyle( pPathBox->GetStyle()|nBits );
pPathBox->SetDoubleClickHdl( LINK( this, DbRegistrationOptionsPage, EditHdl ) );
pPathBox->SetSelectHdl( LINK( this, DbRegistrationOptionsPage, PathSelect_Impl ) );
pPathBox->SetSelectionMode( SINGLE_SELECTION );
pPathBox->SetPosSizePixel( Point( 0, aHeadSize.Height() ),
Size( aBoxSize.Width(), aBoxSize.Height() - aHeadSize.Height() ) );
- pPathBox->SetTabs( &nTabs[0], MAP_APPFONT );
- pPathBox->InitHeaderBar( pHeaderBar );
+ pPathBox->SvxSimpleTable::SetTabs( aTabs, MAP_APPFONT );
pPathBox->SetHighlightRange();
pPathBox->SetHelpId( HID_DBPATH_CTL_PATH );
- pHeaderBar->SetHelpId( HID_DBPATH_HEADERBAR );
+ rBar.SetHelpId( HID_DBPATH_HEADERBAR );
- pPathBox->Show();
- pHeaderBar->Show();
+ pPathBox->ShowTable();
FreeResource();
}
@@ -170,14 +166,9 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( Window* pParent, const Sfx
DbRegistrationOptionsPage::~DbRegistrationOptionsPage()
{
- // #110603# do not grab focus to a destroyed window !!!
- aPathCtrl.SetFocusControl( NULL );
-
- pHeaderBar->Hide();
for ( sal_uInt16 i = 0; i < pPathBox->GetEntryCount(); ++i )
delete static_cast< DatabaseRegistration* >( pPathBox->GetEntry(i)->GetUserData() );
delete pPathBox;
- delete pHeaderBar;
}
// -----------------------------------------------------------------------
@@ -240,12 +231,14 @@ void DbRegistrationOptionsPage::Reset( const SfxItemSet& rSet )
String aUserData = GetUserData();
if ( aUserData.Len() )
{
+ HeaderBar &rBar = pPathBox->GetTheHeaderBar();
+
// restore column width
- pHeaderBar->SetItemSize( ITEMID_TYPE, aUserData.GetToken(0).ToInt32() );
+ rBar.SetItemSize( ITEMID_TYPE, aUserData.GetToken(0).ToInt32() );
HeaderEndDrag_Impl( NULL );
// restore sort direction
sal_Bool bUp = (sal_Bool)(sal_uInt16)aUserData.GetToken(1).ToInt32();
- HeaderBarItemBits nBits = pHeaderBar->GetItemBits(ITEMID_TYPE);
+ HeaderBarItemBits nBits = rBar.GetItemBits(ITEMID_TYPE);
if ( bUp )
{
@@ -257,7 +250,7 @@ void DbRegistrationOptionsPage::Reset( const SfxItemSet& rSet )
nBits &= ~HIB_DOWNARROW;
nBits |= HIB_UPARROW;
}
- pHeaderBar->SetItemBits( ITEMID_TYPE, nBits );
+ rBar.SetItemBits( ITEMID_TYPE, nBits );
HeaderSelect_Impl( NULL );
}
}
@@ -266,8 +259,10 @@ void DbRegistrationOptionsPage::Reset( const SfxItemSet& rSet )
void DbRegistrationOptionsPage::FillUserData()
{
- OUString aUserData = OUString::number( pHeaderBar->GetItemSize( ITEMID_TYPE ) ) + ";";
- HeaderBarItemBits nBits = pHeaderBar->GetItemBits( ITEMID_TYPE );
+ HeaderBar &rBar = pPathBox->GetTheHeaderBar();
+
+ OUString aUserData = OUString::number( rBar.GetItemSize( ITEMID_TYPE ) ) + ";";
+ HeaderBarItemBits nBits = rBar.GetItemBits( ITEMID_TYPE );
sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
aUserData += (bUp ? OUString("1") : OUString("0"));
SetUserData( aUserData );
@@ -320,7 +315,7 @@ IMPL_LINK( DbRegistrationOptionsPage, HeaderSelect_Impl, HeaderBar*, pBar )
if ( pBar && pBar->GetCurItemId() != ITEMID_TYPE )
return 0;
- HeaderBarItemBits nBits = pHeaderBar->GetItemBits(ITEMID_TYPE);
+ HeaderBarItemBits nBits = pBar->GetItemBits(ITEMID_TYPE);
sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
SvSortMode eMode = SortAscending;
@@ -335,7 +330,7 @@ IMPL_LINK( DbRegistrationOptionsPage, HeaderSelect_Impl, HeaderBar*, pBar )
nBits &= ~HIB_DOWNARROW;
nBits |= HIB_UPARROW;
}
- pHeaderBar->SetItemBits( ITEMID_TYPE, nBits );
+ pBar->SetItemBits( ITEMID_TYPE, nBits );
SvTreeList* pModel = pPathBox->GetModel();
pModel->SetSortMode( eMode );
pModel->Resort();
@@ -349,22 +344,22 @@ IMPL_LINK( DbRegistrationOptionsPage, HeaderEndDrag_Impl, HeaderBar*, pBar )
if ( pBar && !pBar->GetCurItemId() )
return 0;
- if ( !pHeaderBar->IsItemMode() )
+ if ( !pBar->IsItemMode() )
{
Size aSz;
- sal_uInt16 nTabs = pHeaderBar->GetItemCount();
+ sal_uInt16 nTabs = pBar->GetItemCount();
long nTmpSz = 0;
- long nWidth = pHeaderBar->GetItemSize(ITEMID_TYPE);
- long nBarWidth = pHeaderBar->GetSizePixel().Width();
+ long nWidth = pBar->GetItemSize(ITEMID_TYPE);
+ long nBarWidth = pBar->GetSizePixel().Width();
if(nWidth < TAB_WIDTH_MIN)
- pHeaderBar->SetItemSize( ITEMID_TYPE, TAB_WIDTH_MIN);
+ pBar->SetItemSize( ITEMID_TYPE, TAB_WIDTH_MIN);
else if ( ( nBarWidth - nWidth ) < TAB_WIDTH_MIN )
- pHeaderBar->SetItemSize( ITEMID_TYPE, nBarWidth - TAB_WIDTH_MIN );
+ pBar->SetItemSize( ITEMID_TYPE, nBarWidth - TAB_WIDTH_MIN );
for ( sal_uInt16 i = 1; i <= nTabs; ++i )
{
- long _nWidth = pHeaderBar->GetItemSize(i);
+ long _nWidth = pBar->GetItemSize(i);
aSz.Width() = _nWidth + nTmpSz;
nTmpSz += _nWidth;
pPathBox->SetTab( i, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width(), MAP_APPFONT );
diff --git a/cui/source/options/optHeaderTabListbox.cxx b/cui/source/options/optHeaderTabListbox.cxx
index 7a6351816b61..0ad304972b75 100644
--- a/cui/source/options/optHeaderTabListbox.cxx
+++ b/cui/source/options/optHeaderTabListbox.cxx
@@ -53,9 +53,8 @@ void OptLBoxString_Impl::Paint(
}
// -----------------------------------------------------------------------------
-OptHeaderTabListBox::OptHeaderTabListBox( Window* pParent, WinBits nWinStyle ) :
-
- SvHeaderTabListBox( pParent, nWinStyle )
+OptHeaderTabListBox::OptHeaderTabListBox(SvxSimpleTableContainer& rParent, WinBits nWinStyle)
+ : SvxSimpleTable(rParent, nWinStyle)
{
}
diff --git a/cui/source/options/optHeaderTabListbox.hxx b/cui/source/options/optHeaderTabListbox.hxx
index 8124a1c3205d..cb4e1f2e8f0f 100644
--- a/cui/source/options/optHeaderTabListbox.hxx
+++ b/cui/source/options/optHeaderTabListbox.hxx
@@ -19,16 +19,16 @@
#ifndef SVX_OPTHEADERTABLISTBOX_HXX
#define SVX_OPTHEADERTABLISTBOX_HXX
-#include <svtools/svtabbx.hxx>
+#include <svx/simptabl.hxx>
namespace svx
{
// class OptHeaderTabListBox ---------------------------------------------
- class OptHeaderTabListBox : public SvHeaderTabListBox
+ class OptHeaderTabListBox : public SvxSimpleTable
{
public:
- OptHeaderTabListBox( Window* pParent, WinBits nBits );
+ OptHeaderTabListBox(SvxSimpleTableContainer& rParent, WinBits nBits);
virtual void InitEntry(SvTreeListEntry*, const OUString&, const Image&, const Image&, SvLBoxButtonKind);
};
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index 769e7be2cabd..5c322aec6cfe 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -37,7 +37,6 @@
#include "optpath.hxx"
#include <dialmgr.hxx>
-#include "optpath.hrc"
#include <cuires.hrc>
#include "helpid.hrc"
#include <comphelper/configuration.hxx>
@@ -63,9 +62,7 @@ using namespace svx;
// define ----------------------------------------------------------------
-#define TAB_WIDTH1 80
#define TAB_WIDTH_MIN 10
-#define TAB_WIDTH2 1000
#define ITEMID_TYPE 1
#define ITEMID_PATH 2
@@ -81,11 +78,12 @@ struct OptPath_Impl
{
SvtDefaultOptions m_aDefOpt;
Image m_aLockImage;
- String m_sMultiPathDlg;
+ OUString m_sMultiPathDlg;
Reference< XPropertySet > m_xPathSettings;
- OptPath_Impl(const ResId& rLockRes)
- : m_aLockImage(rLockRes)
+ OptPath_Impl(const Image& rLockImage, const OUString& rMultiPathDlg)
+ : m_aLockImage(rLockImage)
+ , m_sMultiPathDlg(rMultiPathDlg)
{
}
};
@@ -200,61 +198,50 @@ sal_Bool IsMultiPath_Impl( const sal_uInt16 nIndex )
// class SvxPathTabPage --------------------------------------------------
-SvxPathTabPage::SvxPathTabPage( Window* pParent, const SfxItemSet& rSet ) :
+SvxPathTabPage::SvxPathTabPage(Window* pParent, const SfxItemSet& rSet)
+ :SfxTabPage( pParent, "OptPathsPage", "cui/ui/optpathspage.ui", rSet)
+ , xDialogListener ( new ::svt::DialogClosedListener() )
+{
+ pImpl = new OptPath_Impl(get<FixedImage>("lock")->GetImage(),
+ get<FixedText>("editpaths")->GetText());
+ get(m_pStandardBtn, "default");
+ get(m_pPathBtn, "edit");
+ get(m_pPathCtrl, "paths");
- SfxTabPage( pParent, CUI_RES( RID_SFXPAGE_PATH ), rSet ),
+ m_pStandardBtn->SetClickHdl(LINK(this, SvxPathTabPage, StandardHdl_Impl));
+ Link aLink = LINK( this, SvxPathTabPage, PathHdl_Impl );
+ m_pPathBtn->SetClickHdl( aLink );
- aStdBox ( this, CUI_RES( GB_STD ) ),
- aTypeText ( this, CUI_RES( FT_TYPE ) ),
- aPathText ( this, CUI_RES( FT_PATH ) ),
- aPathCtrl ( this, CUI_RES( LB_PATH ) ),
- aStandardBtn ( this, CUI_RES( BTN_STANDARD ) ),
- aPathBtn ( this, CUI_RES( BTN_PATH ) ),
- pHeaderBar ( NULL ),
- pPathBox ( NULL ),
- pImpl ( new OptPath_Impl( CUI_RES(IMG_LOCK) ) ),
- xDialogListener ( new ::svt::DialogClosedListener() )
+ Size aControlSize(236 , 147);
+ aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
+ m_pPathCtrl->set_width_request(aControlSize.Width());
+ m_pPathCtrl->set_height_request(aControlSize.Height());
+ WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
+ pPathBox = new svx::OptHeaderTabListBox( *m_pPathCtrl, nBits );
-{
- pImpl->m_sMultiPathDlg = String( CUI_RES( STR_MULTIPATHDLG ) );
- aStandardBtn.SetClickHdl( LINK( this, SvxPathTabPage, StandardHdl_Impl ) );
- Link aLink = LINK( this, SvxPathTabPage, PathHdl_Impl );
- aPathBtn.SetClickHdl( aLink );
- Size aBoxSize = aPathCtrl.GetOutputSizePixel();
- pHeaderBar = new HeaderBar( &aPathCtrl, WB_BUTTONSTYLE | WB_BOTTOMBORDER );
- pHeaderBar->SetPosSizePixel( Point( 0, 0 ), Size( aBoxSize.Width(), 16 ) );
- pHeaderBar->SetSelectHdl( LINK( this, SvxPathTabPage, HeaderSelect_Impl ) );
- pHeaderBar->SetEndDragHdl( LINK( this, SvxPathTabPage, HeaderEndDrag_Impl ) );
- Size aSz;
- aSz.Width() = TAB_WIDTH1;
- pHeaderBar->InsertItem( ITEMID_TYPE, aTypeText.GetText(),
- LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
+ HeaderBar &rBar = pPathBox->GetTheHeaderBar();
+ rBar.SetSelectHdl( LINK( this, SvxPathTabPage, HeaderSelect_Impl ) );
+ rBar.SetEndDragHdl( LINK( this, SvxPathTabPage, HeaderEndDrag_Impl ) );
+
+ rBar.InsertItem( ITEMID_TYPE, get<FixedText>("type")->GetText(),
+ 0,
HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_UPARROW );
- aSz.Width() = TAB_WIDTH2;
- pHeaderBar->InsertItem( ITEMID_PATH, aPathText.GetText(),
- LogicToPixel( aSz, MapMode( MAP_APPFONT ) ).Width(),
+ rBar.InsertItem( ITEMID_PATH, get<FixedText>("path")->GetText(),
+ 0,
HIB_LEFT | HIB_VCENTER );
- static long nTabs[] = {3, 0, TAB_WIDTH1, TAB_WIDTH1 + TAB_WIDTH2 };
- Size aHeadSize = pHeaderBar->GetSizePixel();
+ long nWidth1 = rBar.GetTextWidth(rBar.GetItemText(1));
+ long nWidth2 = rBar.GetTextWidth(rBar.GetItemText(2));
+
+ long aTabs[] = {3, 0, 0, 0};
+ aTabs[2] = nWidth1 + 12;
+ aTabs[3] = aTabs[2] + nWidth2 + 12;
+ pPathBox->SetTabs(aTabs, MAP_PIXEL);
- WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
- pPathBox = new svx::OptHeaderTabListBox( &aPathCtrl, nBits );
- aPathCtrl.SetFocusControl( pPathBox );
pPathBox->SetDoubleClickHdl( aLink );
pPathBox->SetSelectHdl( LINK( this, SvxPathTabPage, PathSelect_Impl ) );
pPathBox->SetSelectionMode( MULTIPLE_SELECTION );
- pPathBox->SetPosSizePixel( Point( 0, aHeadSize.Height() ),
- Size( aBoxSize.Width(), aBoxSize.Height() - aHeadSize.Height() ) );
- pPathBox->SetTabs( &nTabs[0], MAP_APPFONT );
- pPathBox->InitHeaderBar( pHeaderBar );
pPathBox->SetHighlightRange();
- pPathBox->SetHelpId( HID_OPTPATH_CTL_PATH );
- pHeaderBar->SetHelpId( HID_OPTPATH_HEADERBAR );
- pPathBox->Show();
- pHeaderBar->Show();
-
- FreeResource();
xDialogListener->SetDialogClosedLink( LINK( this, SvxPathTabPage, DialogClosedHdl ) );
}
@@ -263,14 +250,9 @@ SvxPathTabPage::SvxPathTabPage( Window* pParent, const SfxItemSet& rSet ) :
SvxPathTabPage::~SvxPathTabPage()
{
- // #110603# do not grab focus to a destroyed window !!!
- aPathCtrl.SetFocusControl( NULL );
-
- pHeaderBar->Hide();
for ( sal_uInt16 i = 0; i < pPathBox->GetEntryCount(); ++i )
delete (PathUserData_Impl*)pPathBox->GetEntry(i)->GetUserData();
delete pPathBox;
- delete pHeaderBar;
delete pImpl;
}
@@ -304,6 +286,10 @@ void SvxPathTabPage::Reset( const SfxItemSet& )
pPathBox->Clear();
SvtPathOptions aPathOpt; //! deprecated
+ HeaderBar &rBar = pPathBox->GetTheHeaderBar();
+ long nWidth1 = rBar.GetTextWidth(rBar.GetItemText(1));
+ long nWidth2 = rBar.GetTextWidth(rBar.GetItemText(2));
+
for( sal_uInt16 i = 0; i <= (sal_uInt16)SvtPathOptions::PATH_WORK; ++i )
{
// only writer uses autotext
@@ -327,6 +313,8 @@ void SvxPathTabPage::Reset( const SfxItemSet& )
case SvtPathOptions::PATH_WORK:
{
String aStr( CUI_RES( RID_SVXSTR_PATH_NAME_START + i ) );
+ nWidth1 = std::max(nWidth1, pPathBox->GetTextWidth(aStr));
+ aStr += '\t';
String sInternal, sUser, sWritable;
sal_Bool bReadOnly = sal_False;
GetPathList( i, sInternal, sUser, sWritable, bReadOnly );
@@ -335,8 +323,9 @@ void SvxPathTabPage::Reset( const SfxItemSet& )
sTmpPath += MULTIPATH_DELIMITER;
sTmpPath += sWritable;
String aValue( sTmpPath );
- aStr += '\t';
- aStr += Convert_Impl( aValue );
+ aValue = Convert_Impl( aValue );
+ nWidth2 = std::max(nWidth2, pPathBox->GetTextWidth(aValue));
+ aStr += aValue;
SvTreeListEntry* pEntry = pPathBox->InsertEntry( aStr );
if ( bReadOnly )
{
@@ -350,15 +339,23 @@ void SvxPathTabPage::Reset( const SfxItemSet& )
}
}
+ long aTabs[] = {3, 0, 0, 0};
+ aTabs[2] = nWidth1 + 12;
+ aTabs[3] = aTabs[2] + nWidth2 + 12;
+ pPathBox->SetTabs(aTabs, MAP_PIXEL);
+
+#if 0
String aUserData = GetUserData();
if ( aUserData.Len() )
{
+ fprintf(stderr, "FOO\n");
+
// restore column width
- pHeaderBar->SetItemSize( ITEMID_TYPE, aUserData.GetToken(0).ToInt32() );
- HeaderEndDrag_Impl( NULL );
+ rBar.SetItemSize( ITEMID_TYPE, aUserData.GetToken(0).ToInt32() );
+ HeaderEndDrag_Impl( &rBar );
// restore sort direction
sal_Bool bUp = (sal_Bool)(sal_uInt16)aUserData.GetToken(1).ToInt32();
- HeaderBarItemBits nBits = pHeaderBar->GetItemBits(ITEMID_TYPE);
+ HeaderBarItemBits nBits = rBar.GetItemBits(ITEMID_TYPE);
if ( bUp )
{
@@ -370,9 +367,10 @@ void SvxPathTabPage::Reset( const SfxItemSet& )
nBits &= ~HIB_DOWNARROW;
nBits |= HIB_UPARROW;
}
- pHeaderBar->SetItemBits( ITEMID_TYPE, nBits );
- HeaderSelect_Impl( NULL );
+ rBar.SetItemBits( ITEMID_TYPE, nBits );
+ HeaderSelect_Impl( &rBar );
}
+#endif
PathSelect_Impl( NULL );
}
@@ -380,8 +378,10 @@ void SvxPathTabPage::Reset( const SfxItemSet& )
void SvxPathTabPage::FillUserData()
{
- String aUserData = OUString::number( pHeaderBar->GetItemSize( ITEMID_TYPE ) ) + ";";
- HeaderBarItemBits nBits = pHeaderBar->GetItemBits( ITEMID_TYPE );
+ HeaderBar &rBar = pPathBox->GetTheHeaderBar();
+
+ String aUserData = OUString::number( rBar.GetItemSize( ITEMID_TYPE ) ) + ";";
+ HeaderBarItemBits nBits = rBar.GetItemBits( ITEMID_TYPE );
sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
aUserData += bUp ? '1' : '0';
SetUserData( aUserData );
@@ -405,8 +405,8 @@ IMPL_LINK_NOARG(SvxPathTabPage, PathSelect_Impl)
pEntry = pPathBox->NextSelected( pEntry );
}
- aPathBtn.Enable( 1 == nSelCount && bEnable);
- aStandardBtn.Enable( nSelCount > 0 && bEnable);
+ m_pPathBtn->Enable( 1 == nSelCount && bEnable);
+ m_pStandardBtn->Enable( nSelCount > 0 && bEnable);
return 0;
}
@@ -645,7 +645,7 @@ IMPL_LINK( SvxPathTabPage, HeaderSelect_Impl, HeaderBar*, pBar )
if ( pBar && pBar->GetCurItemId() != ITEMID_TYPE )
return 0;
- HeaderBarItemBits nBits = pHeaderBar->GetItemBits(ITEMID_TYPE);
+ HeaderBarItemBits nBits = pBar->GetItemBits(ITEMID_TYPE);
sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
SvSortMode eMode = SortAscending;
@@ -660,7 +660,7 @@ IMPL_LINK( SvxPathTabPage, HeaderSelect_Impl, HeaderBar*, pBar )
nBits &= ~HIB_DOWNARROW;
nBits |= HIB_UPARROW;
}
- pHeaderBar->SetItemBits( ITEMID_TYPE, nBits );
+ pBar->SetItemBits( ITEMID_TYPE, nBits );
SvTreeList* pModel = pPathBox->GetModel();
pModel->SetSortMode( eMode );
pModel->Resort();
@@ -674,22 +674,22 @@ IMPL_LINK( SvxPathTabPage, HeaderEndDrag_Impl, HeaderBar*, pBar )
if ( pBar && !pBar->GetCurItemId() )
return 0;
- if ( !pHeaderBar->IsItemMode() )
+ if ( !pBar->IsItemMode() )
{
Size aSz;
- sal_uInt16 nTabs = pHeaderBar->GetItemCount();
+ sal_uInt16 nTabs = pBar->GetItemCount();
long nTmpSz = 0;
- long nWidth = pHeaderBar->GetItemSize(ITEMID_TYPE);
- long nBarWidth = pHeaderBar->GetSizePixel().Width();
+ long nWidth = pBar->GetItemSize(ITEMID_TYPE);
+ long nBarWidth = pBar->GetSizePixel().Width();
if(nWidth < TAB_WIDTH_MIN)
- pHeaderBar->SetItemSize( ITEMID_TYPE, TAB_WIDTH_MIN);
+ pBar->SetItemSize( ITEMID_TYPE, TAB_WIDTH_MIN);
else if ( ( nBarWidth - nWidth ) < TAB_WIDTH_MIN )
- pHeaderBar->SetItemSize( ITEMID_TYPE, nBarWidth - TAB_WIDTH_MIN );
+ pBar->SetItemSize( ITEMID_TYPE, nBarWidth - TAB_WIDTH_MIN );
for ( sal_uInt16 i = 1; i <= nTabs; ++i )
{
- long _nWidth = pHeaderBar->GetItemSize(i);
+ long _nWidth = pBar->GetItemSize(i);
aSz.Width() = _nWidth + nTmpSz;
nTmpSz += _nWidth;
pPathBox->SetTab( i, PixelToLogic( aSz, MapMode(MAP_APPFONT) ).Width(), MAP_APPFONT );
diff --git a/cui/source/options/optpath.hrc b/cui/source/options/optpath.hrc
deleted file mode 100644
index 3b1a259e24f5..000000000000
--- a/cui/source/options/optpath.hrc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef _SVX_OPTPATH_HRC
-#define _SVX_OPTPATH_HRC
-
-// defines ---------------------------------------------------------------
-
-#define FT_TYPE 10
-#define FT_PATH 11
-#define LB_PATH 12
-#define BTN_PATH 13
-#define BTN_STANDARD 14
-#define GB_STD 15
-#define IMG_LOCK 16
-#define STR_MULTIPATHDLG 17
-
-#endif
-
diff --git a/cui/source/options/optpath.src b/cui/source/options/optpath.src
index ff4a80061de2..8173a701256f 100644
--- a/cui/source/options/optpath.src
+++ b/cui/source/options/optpath.src
@@ -15,79 +15,17 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "optpath.hrc"
#include <cuires.hrc>
#include <sfx2/sfx.hrc>
#include "helpid.hrc"
- // RID_SFXPAGE_PATH -----------------------------------------------------
-#define STD_MASKCOLOR Color { Red=0xffff; Green=0x0000; Blue=0xffff; }
-TabPage RID_SFXPAGE_PATH
-{
- HelpId = HID_OPTIONS_PATH ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
- Text [ en-US ] = "Paths" ;
- FixedText FT_TYPE
- {
- Hide = TRUE;
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "Type" ;
- };
- FixedText FT_PATH
- {
- Hide = TRUE;
- Pos = MAP_APPFONT ( 110 , 14 ) ;
- Size = MAP_APPFONT ( 40 , 10 ) ;
- Text [ en-US ] = "Path" ;
- };
- Control LB_PATH
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 236 , 147 ) ;
- Border = TRUE ;
- TabStop = TRUE;
- };
- PushButton BTN_PATH
- {
- HelpID = "cui:PushButton:RID_SFXPAGE_PATH:BTN_PATH";
- Pos = MAP_APPFONT ( 183 , 165 ) ;
- Size = MAP_APPFONT ( 65 , 14 ) ;
- Text [ en-US ] = "~Edit..." ;
- };
- PushButton BTN_STANDARD
- {
- HelpID = "cui:PushButton:RID_SFXPAGE_PATH:BTN_STANDARD";
- Pos = MAP_APPFONT ( 115 , 165 ) ;
- Size = MAP_APPFONT ( 65 , 14 ) ;
- Text [ en-US ] = "~Default" ;
- };
- FixedLine GB_STD
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Paths used by %PRODUCTNAME" ;
- };
- Image IMG_LOCK
- {
- ImageBitmap = Bitmap { File = "lock.bmp"; };
- MaskColor = STD_MASKCOLOR;
- };
- String STR_MULTIPATHDLG
- {
- Text [ en-US ] = "Edit Paths: %1" ;
- };
-};
ErrorBox RID_SVXERR_OPT_DOUBLEPATHS
{
BUTTONS = WB_OK ;
DEFBUTTON = WB_DEF_OK ;
Message [ en-US ] = "The configuration and mail directories must be specified as separate directories.\nPlease choose a new path." ;
};
- // ******************************************************************* EOF
+
String RID_SVXSTR_KEY_CONFIG_DIR
{
Text [ en-US ] = "Configuration" ;
@@ -108,7 +46,6 @@ String RID_SVXSTR_KEY_BASIC_PATH
{
Text = "BASIC" ;
};
-
String RID_SVXSTR_KEY_PALETTE_PATH
{
Text [ en-US ] = "Palettes" ;
@@ -141,7 +78,6 @@ String RID_SVXSTR_KEY_GALLERY_DIR
{
Text [ en-US ] = "Gallery" ;
};
-
String RID_SVXSTR_KEY_STORAGE_DIR
{
Text [ en-US ] = "Message Storage" ;