[Libreoffice-commits] core.git: Branch 'feature/aboutconfig' - cui/source
Efe Gürkan YALAMAN
efeyalaman at gmail.com
Fri Jul 26 15:18:58 PDT 2013
cui/source/options/optaboutconfig.cxx | 36 ++++++++++++++++++++++++++++++----
cui/source/options/optaboutconfig.hxx | 2 +
2 files changed, 34 insertions(+), 4 deletions(-)
New commits:
commit 6a2c82bba50a338dce72ffaae0b2b8c9252aeaea
Author: Efe Gürkan YALAMAN <efeyalaman at gmail.com>
Date: Sat Jul 27 01:17:54 2013 +0300
Header bar sorting implemented.
Change-Id: I2c80b6f7973053c78af430b458ae2f9e5532532e
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 56c0d0a..c36a195 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -47,10 +47,10 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( Window* pParent, const SfxItemSet&
pPrefBox = new svx::OptHeaderTabListBox( *m_pPrefCtrl, nBits );
HeaderBar &rBar = pPrefBox->GetTheHeaderBar();
- rBar.InsertItem( ITEMID_PREF, get<FixedText>("preference")->GetText(), 0, HIB_LEFT | HIB_VCENTER );
- rBar.InsertItem( ITEMID_TYPE, get<FixedText>("status")->GetText(), 0, HIB_LEFT | HIB_VCENTER );
- rBar.InsertItem( ITEMID_STATUS, get<FixedText>("type")->GetText(), 0, HIB_LEFT | HIB_VCENTER );
- rBar.InsertItem( ITEMID_VALUE, get<FixedText>("value")->GetText(), 0, HIB_LEFT | HIB_VCENTER );
+ rBar.InsertItem( ITEMID_PREF, get<FixedText>("preference")->GetText(), 0, HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_UPARROW);
+ rBar.InsertItem( ITEMID_TYPE, get<FixedText>("status")->GetText(), 0, HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_UPARROW );
+ rBar.InsertItem( ITEMID_STATUS, get<FixedText>("type")->GetText(), 0, HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_UPARROW );
+ rBar.InsertItem( ITEMID_VALUE, get<FixedText>("value")->GetText(), 0, HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE | HIB_UPARROW );
long aTabs[] = {4,0,12,12,12};
@@ -235,4 +235,32 @@ Reference< XNameAccess > CuiAboutConfigTabPage::getConfigAccess( OUString sNodeP
return xNameAccess;
}
+
+IMPL_LINK( CuiAboutConfigTabPage, HeaderSelect_Impl, HeaderBar*, pBar )
+{
+ if ( pBar && pBar->GetCurItemId() != ITEMID_TYPE )
+ return 0;
+
+ HeaderBarItemBits nBits = pBar->GetItemBits(ITEMID_TYPE);
+ sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
+ SvSortMode eMode = SortAscending;
+
+ if ( bUp )
+ {
+ nBits &= ~HIB_UPARROW;
+ nBits |= HIB_DOWNARROW;
+ eMode = SortDescending;
+ }
+ else
+ {
+ nBits &= ~HIB_DOWNARROW;
+ nBits |= HIB_UPARROW;
+ }
+ pBar->SetItemBits( ITEMID_TYPE, nBits );
+ SvTreeList* pModel = pPrefBox->GetModel();
+ pModel->SetSortMode( eMode );
+ pModel->Resort();
+ return 1;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/optaboutconfig.hxx b/cui/source/options/optaboutconfig.hxx
index 9421328..22661d7 100644
--- a/cui/source/options/optaboutconfig.hxx
+++ b/cui/source/options/optaboutconfig.hxx
@@ -31,6 +31,8 @@ private:
::svx::OptHeaderTabListBox* pPrefBox;
CuiAboutConfigTabPage( Window* pParent, const SfxItemSet& rItemSet );
~CuiAboutConfigTabPage();
+
+ DECL_LINK( HeaderSelect_Impl, HeaderBar * );
public:
static SfxTabPage* Create( Window* pParent, const SfxItemSet& rItemset );
More information about the Libreoffice-commits
mailing list