Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
f4bfce94
Kaydet (Commit)
f4bfce94
authored
Eyl 13, 2013
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
select sheet menu as a right-click popup to the prev/next sheet dingus
Change-Id: Ifc9baeabedeab526d040220e9e45f171b5353bcf
üst
d90fa389
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
19 deletions
+93
-19
tabbar.hxx
include/svtools/tabbar.hxx
+6
-0
tabcont.hxx
sc/source/ui/inc/tabcont.hxx
+3
-0
tabcont.cxx
sc/source/ui/view/tabcont.cxx
+53
-16
tabbar.cxx
svtools/source/control/tabbar.cxx
+31
-3
No files found.
include/svtools/tabbar.hxx
Dosyayı görüntüle @
f4bfce94
...
...
@@ -369,6 +369,7 @@ private:
sal_Bool
mbSelTextColor
;
bool
mbMirrored
;
bool
mbHasInsertTab
;
// if true, the tab bar has an extra tab at the end.
bool
mbScrollAlwaysEnabled
;
Link
maSelectHdl
;
Link
maDoubleClickHdl
;
Link
maSplitHdl
;
...
...
@@ -377,6 +378,7 @@ private:
Link
maStartRenamingHdl
;
Link
maAllowRenamingHdl
;
Link
maEndRenamingHdl
;
Link
maScrollAreaContextHdl
;
size_t
maCurrentItemList
;
using
Window
::
ImplInit
;
...
...
@@ -529,6 +531,8 @@ public:
void
SetStyle
(
WinBits
nStyle
);
WinBits
GetStyle
()
const
{
return
mnWinStyle
;
}
void
SetScrollAlwaysEnabled
(
bool
bScrollAlwaysEnabled
);
Size
CalcWindowSizePixel
()
const
;
void
SetSelectHdl
(
const
Link
&
rLink
)
{
maSelectHdl
=
rLink
;
}
...
...
@@ -547,6 +551,8 @@ public:
const
Link
&
GetAllowRenamingHdl
()
const
{
return
maAllowRenamingHdl
;
}
void
SetEndRenamingHdl
(
const
Link
&
rLink
)
{
maEndRenamingHdl
=
rLink
;
}
const
Link
&
GetEndRenamingHdl
()
const
{
return
maEndRenamingHdl
;
}
void
SetScrollAreaContextHdl
(
const
Link
&
rLink
)
{
maScrollAreaContextHdl
=
rLink
;
}
const
Link
&
GetScrollAreaContextHdl
()
const
{
return
maScrollAreaContextHdl
;
}
// accessibility
virtual
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
accessibility
::
XAccessible
>
CreateAccessible
();
...
...
sc/source/ui/inc/tabcont.hxx
Dosyayı görüntüle @
f4bfce94
...
...
@@ -46,6 +46,9 @@ private:
sal_uInt16
GetMaxId
()
const
;
SCTAB
GetPrivatDropPos
(
const
Point
&
rPos
);
DECL_LINK
(
ShowPageList
,
const
CommandEvent
*
);
void
SwitchToPageId
(
sal_uInt16
nId
);
protected
:
virtual
void
Select
();
virtual
void
Command
(
const
CommandEvent
&
rCEvt
);
...
...
sc/source/ui/view/tabcont.cxx
Dosyayı görüntüle @
f4bfce94
...
...
@@ -81,6 +81,39 @@ ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) :
EnableEditMode
();
UpdateInputContext
();
SetScrollAlwaysEnabled
(
true
);
SetScrollAreaContextHdl
(
LINK
(
this
,
ScTabControl
,
ShowPageList
)
);
}
IMPL_LINK
(
ScTabControl
,
ShowPageList
,
const
CommandEvent
*
,
pEvent
)
{
PopupMenu
aPopup
;
sal_uInt16
nCurPageId
=
GetCurPageId
();
ScDocument
*
pDoc
=
pViewData
->
GetDocument
();
SCTAB
nCount
=
pDoc
->
GetTableCount
();
for
(
SCTAB
i
=
0
;
i
<
nCount
;
++
i
)
{
if
(
pDoc
->
IsVisible
(
i
))
{
OUString
aString
;
if
(
pDoc
->
GetName
(
i
,
aString
))
{
sal_uInt16
nId
=
static_cast
<
sal_uInt16
>
(
i
)
+
1
;
aPopup
.
InsertItem
(
nId
,
aString
,
MIB_CHECKABLE
);
if
(
nId
==
nCurPageId
)
aPopup
.
CheckItem
(
nId
);
}
}
}
sal_uInt16
nItemId
=
aPopup
.
Execute
(
this
,
pEvent
->
GetMousePosPixel
()
);
SwitchToPageId
(
nItemId
);
return
0
;
}
ScTabControl
::~
ScTabControl
()
...
...
@@ -368,6 +401,25 @@ void ScTabControl::SetSheetLayoutRTL( sal_Bool bSheetRTL )
nSelPageIdByMouse
=
TabBar
::
PAGE_NOT_FOUND
;
}
void
ScTabControl
::
SwitchToPageId
(
sal_uInt16
nId
)
{
if
(
nId
)
{
sal_Bool
bAlreadySelected
=
IsPageSelected
(
nId
);
//make the clicked page the current one
SetCurPageId
(
nId
);
//change the selection when the current one is not already
//selected or part of a multi selection
if
(
!
bAlreadySelected
)
{
sal_uInt16
nCount
=
GetMaxId
();
for
(
sal_uInt16
i
=
1
;
i
<=
nCount
;
i
++
)
SelectPage
(
i
,
i
==
nId
);
Select
();
}
}
}
void
ScTabControl
::
Command
(
const
CommandEvent
&
rCEvt
)
{
...
...
@@ -387,22 +439,7 @@ void ScTabControl::Command( const CommandEvent& rCEvt )
// if multiple tables are selected and the one under the cursor
// is not part of them then unselect them
sal_uInt16
nId
=
GetPageId
(
rCEvt
.
GetMousePosPixel
()
);
if
(
nId
)
{
sal_Bool
bAlreadySelected
=
IsPageSelected
(
nId
);
//make the clicked page the current one
SetCurPageId
(
nId
);
//change the selection when the current one is not already
//selected or part of a multi selection
if
(
!
bAlreadySelected
)
{
sal_uInt16
nCount
=
GetMaxId
();
for
(
sal_uInt16
i
=
1
;
i
<=
nCount
;
i
++
)
SelectPage
(
i
,
i
==
nId
);
Select
();
}
}
SwitchToPageId
(
nId
);
// #i52073# OLE inplace editing has to be stopped before showing the sheet tab context menu
pViewSh
->
DeactivateOle
();
...
...
svtools/source/control/tabbar.cxx
Dosyayı görüntüle @
f4bfce94
...
...
@@ -100,13 +100,33 @@ class ImplTabButton : public PushButton
{
public
:
ImplTabButton
(
TabBar
*
pParent
,
WinBits
nWinStyle
=
0
)
:
PushButton
(
pParent
,
nWinStyle
|
WB_RECTSTYLE
|
WB_SMALLSTYLE
|
WB_NOLIGHTBORDER
|
WB_NOPOINTERFOCUS
)
{}
PushButton
(
pParent
,
nWinStyle
|
WB_RECTSTYLE
|
WB_SMALLSTYLE
|
WB_NOLIGHTBORDER
|
WB_NOPOINTERFOCUS
)
{}
TabBar
*
GetParent
()
const
{
return
(
TabBar
*
)
Window
::
GetParent
();
}
virtual
long
PreNotify
(
NotifyEvent
&
rNEvt
);
virtual
void
MouseButtonDown
(
const
MouseEvent
&
rMEvt
);
virtual
void
Command
(
const
CommandEvent
&
rCEvt
);
};
void
ImplTabButton
::
MouseButtonDown
(
const
MouseEvent
&
rMEvt
)
{
PushButton
::
MouseButtonDown
(
rMEvt
);
}
void
ImplTabButton
::
Command
(
const
CommandEvent
&
rCEvt
)
{
sal_uInt16
nCmd
=
rCEvt
.
GetCommand
();
if
(
nCmd
==
COMMAND_CONTEXTMENU
)
{
TabBar
*
pParent
=
GetParent
();
pParent
->
maScrollAreaContextHdl
.
Call
((
void
*
)
&
rCEvt
);
}
PushButton
::
Command
(
rCEvt
);
}
// =======================================================================
long
ImplTabButton
::
PreNotify
(
NotifyEvent
&
rNEvt
)
...
...
@@ -398,6 +418,8 @@ void TabBar::ImplInit( WinBits nWinStyle )
mbSelColor
=
sal_False
;
mbSelTextColor
=
sal_False
;
mbMirrored
=
sal_False
;
mbMirrored
=
sal_False
;
mbScrollAlwaysEnabled
=
false
;
if
(
nWinStyle
&
WB_3DTAB
)
mnOffY
++
;
...
...
@@ -752,19 +774,25 @@ void TabBar::ImplEnableControls()
return
;
// Buttons enablen/disblen
sal_Bool
bEnableBtn
=
mnFirstPos
>
0
;
sal_Bool
bEnableBtn
=
m
bScrollAlwaysEnabled
||
m
nFirstPos
>
0
;
if
(
mpFirstBtn
)
mpFirstBtn
->
Enable
(
bEnableBtn
);
if
(
mpPrevBtn
)
mpPrevBtn
->
Enable
(
bEnableBtn
);
bEnableBtn
=
mnFirstPos
<
ImplGetLastFirstPos
();
bEnableBtn
=
m
bScrollAlwaysEnabled
||
m
nFirstPos
<
ImplGetLastFirstPos
();
if
(
mpNextBtn
)
mpNextBtn
->
Enable
(
bEnableBtn
);
if
(
mpLastBtn
)
mpLastBtn
->
Enable
(
bEnableBtn
);
}
void
TabBar
::
SetScrollAlwaysEnabled
(
bool
bScrollAlwaysEnabled
)
{
mbScrollAlwaysEnabled
=
bScrollAlwaysEnabled
;
ImplEnableControls
();
}
// -----------------------------------------------------------------------
void
TabBar
::
ImplShowPage
(
sal_uInt16
nPos
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment