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
9bcd98fd
Kaydet (Commit)
9bcd98fd
authored
Ara 05, 2012
tarafından
Cédric Bosdonnat
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Template Manager: ban double-click and right click to start selection mode
Change-Id: I49383a884b5806679ec6f79d49b8bc194d28d557
üst
3eaa0cb7
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
80 additions
and
46 deletions
+80
-46
templateabstractview.hxx
sfx2/inc/sfx2/templateabstractview.hxx
+3
-1
templatelocalview.hxx
sfx2/inc/sfx2/templatelocalview.hxx
+1
-1
templateview.hxx
sfx2/inc/sfx2/templateview.hxx
+3
-3
thumbnailview.hxx
sfx2/inc/sfx2/thumbnailview.hxx
+3
-1
templatedlg.hxx
sfx2/inc/templatedlg.hxx
+2
-0
templateabstractview.cxx
sfx2/source/control/templateabstractview.cxx
+28
-9
templatelocalview.cxx
sfx2/source/control/templatelocalview.cxx
+1
-1
templateview.cxx
sfx2/source/control/templateview.cxx
+2
-2
thumbnailview.cxx
sfx2/source/control/thumbnailview.cxx
+21
-25
templatedlg.cxx
sfx2/source/doc/templatedlg.cxx
+16
-3
No files found.
sfx2/inc/sfx2/templateabstractview.hxx
Dosyayı görüntüle @
9bcd98fd
...
...
@@ -106,7 +106,7 @@ public:
void
setOverlayItemStateHdl
(
const
Link
&
aLink
)
{
maOverlayItemStateHdl
=
aLink
;
}
void
setOverlay
Dbl
ClickHdl
(
const
Link
&
rLink
);
void
setOverlayClickHdl
(
const
Link
&
rLink
);
void
setOverlayCloseHdl
(
const
Link
&
rLink
);
...
...
@@ -125,10 +125,12 @@ protected:
virtual
void
OnSelectionMode
(
bool
bMode
);
DECL_LINK
(
OverlayItemStateHdl
,
const
ThumbnailViewItem
*
);
DECL_LINK
(
OverlaySelectionModeHdl
,
bool
*
);
protected
:
TemplateView
*
mpItemView
;
bool
mbInSelectionModeHdl
;
Link
maOverlayItemStateHdl
;
};
...
...
sfx2/inc/sfx2/templatelocalview.hxx
Dosyayı görüntüle @
9bcd98fd
...
...
@@ -75,7 +75,7 @@ public:
private
:
virtual
void
OnItem
Dbl
Clicked
(
ThumbnailViewItem
*
pRegionItem
);
virtual
void
OnItemClicked
(
ThumbnailViewItem
*
pRegionItem
);
DECL_LINK
(
ChangeNameHdl
,
TemplateView
*
);
...
...
sfx2/inc/sfx2/templateview.hxx
Dosyayı görüntüle @
9bcd98fd
...
...
@@ -37,7 +37,7 @@ public:
void
InsertItems
(
const
std
::
vector
<
TemplateItemProperties
>
&
rTemplates
);
void
set
DblClickHdl
(
const
Link
&
rLink
)
{
maDbl
ClickHdl
=
rLink
;
}
void
set
ClickHdl
(
const
Link
&
rLink
)
{
ma
ClickHdl
=
rLink
;
}
void
setChangeNameHdl
(
const
Link
&
rLink
)
{
maChangeNameHdl
=
rLink
;
}
...
...
@@ -49,7 +49,7 @@ protected:
virtual
void
MouseButtonDown
(
const
MouseEvent
&
rMEvt
);
virtual
void
OnItem
Dbl
Clicked
(
ThumbnailViewItem
*
pItem
);
virtual
void
OnItemClicked
(
ThumbnailViewItem
*
pItem
);
DECL_LINK
(
ChangeNameHdl
,
void
*
);
...
...
@@ -59,7 +59,7 @@ private:
bool
mbRenderTitle
;
sal_uInt16
mnId
;
OUString
maName
;
Link
ma
Dbl
ClickHdl
;
Link
maClickHdl
;
Link
maChangeNameHdl
;
Link
maCloseHdl
;
...
...
sfx2/inc/sfx2/thumbnailview.hxx
Dosyayı görüntüle @
9bcd98fd
...
...
@@ -241,6 +241,7 @@ public:
const
ThumbnailViewItem
*
)
>
&
func
);
void
setItemStateHdl
(
const
Link
&
aLink
)
{
maItemStateHdl
=
aLink
;
}
void
setSelectionModeHdl
(
const
Link
&
aLink
)
{
maSelectionModeHdl
=
aLink
;
}
protected
:
...
...
@@ -276,7 +277,7 @@ protected:
virtual
void
OnSelectionMode
(
bool
bMode
);
virtual
void
OnItem
Dbl
Clicked
(
ThumbnailViewItem
*
pItem
);
virtual
void
OnItemClicked
(
ThumbnailViewItem
*
pItem
);
protected
:
...
...
@@ -330,6 +331,7 @@ protected:
Color
maColor
;
Link
maItemStateHdl
;
Link
maSelectionModeHdl
;
ThumbnailItemAttributes
*
mpItemAttrs
;
drawinglayer
::
processor2d
::
BaseProcessor2D
*
mpProcessor
;
boost
::
function
<
bool
(
const
ThumbnailViewItem
*
)
>
maFilterFunc
;
...
...
sfx2/inc/templatedlg.hxx
Dosyayı görüntüle @
9bcd98fd
...
...
@@ -58,6 +58,7 @@ private:
DECL_LINK
(
CloseOverlayHdl
,
void
*
);
DECL_LINK
(
OnClickSelectionMode
,
ImageButton
*
);
DECL_LINK
(
SelectionModeHdl
,
bool
*
);
DECL_LINK
(
TBXViewHdl
,
void
*
);
DECL_LINK
(
TBXActionHdl
,
void
*
);
...
...
@@ -141,6 +142,7 @@ private:
std
::
set
<
const
ThumbnailViewItem
*>
maSelFolders
;
bool
mbIsSaveMode
;
///< Flag that indicates if we are in save mode or not.
bool
mbInSelectionModeHdl
;
///< Flag avoiding selection mode handler loop
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
frame
::
XModel
>
m_xModel
;
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
frame
::
XComponentLoader
>
mxDesktop
;
};
...
...
sfx2/source/control/templateabstractview.cxx
Dosyayı görüntüle @
9bcd98fd
...
...
@@ -58,16 +58,20 @@ bool ViewFilter_Keyword::operator ()(const ThumbnailViewItem *pItem)
TemplateAbstractView
::
TemplateAbstractView
(
Window
*
pParent
,
WinBits
nWinStyle
,
bool
bDisableTransientChildren
)
:
ThumbnailView
(
pParent
,
nWinStyle
,
bDisableTransientChildren
),
mpItemView
(
new
TemplateView
(
this
))
mpItemView
(
new
TemplateView
(
this
)),
mbInSelectionModeHdl
(
false
)
{
mpItemView
->
setItemStateHdl
(
LINK
(
this
,
TemplateAbstractView
,
OverlayItemStateHdl
));
mpItemView
->
setSelectionModeHdl
(
LINK
(
this
,
TemplateAbstractView
,
OverlaySelectionModeHdl
));
}
TemplateAbstractView
::
TemplateAbstractView
(
Window
*
pParent
,
const
ResId
&
rResId
,
bool
bDisableTransientChildren
)
:
ThumbnailView
(
pParent
,
rResId
,
bDisableTransientChildren
),
mpItemView
(
new
TemplateView
(
this
))
mpItemView
(
new
TemplateView
(
this
)),
mbInSelectionModeHdl
(
false
)
{
mpItemView
->
setItemStateHdl
(
LINK
(
this
,
TemplateAbstractView
,
OverlayItemStateHdl
));
mpItemView
->
setSelectionModeHdl
(
LINK
(
this
,
TemplateAbstractView
,
OverlaySelectionModeHdl
));
}
TemplateAbstractView
::~
TemplateAbstractView
()
...
...
@@ -119,9 +123,9 @@ void TemplateAbstractView::filterTemplatesByKeyword(const OUString &rKeyword)
mpItemView
->
filterItems
(
ViewFilter_Keyword
(
rKeyword
));
}
void
TemplateAbstractView
::
setOverlay
Dbl
ClickHdl
(
const
Link
&
rLink
)
void
TemplateAbstractView
::
setOverlayClickHdl
(
const
Link
&
rLink
)
{
mpItemView
->
set
Dbl
ClickHdl
(
rLink
);
mpItemView
->
setClickHdl
(
rLink
);
}
void
TemplateAbstractView
::
setOverlayCloseHdl
(
const
Link
&
rLink
)
...
...
@@ -269,13 +273,16 @@ void TemplateAbstractView::DrawItem(ThumbnailViewItem *pItem)
void
TemplateAbstractView
::
OnSelectionMode
(
bool
bMode
)
{
if
(
mpItemView
->
IsVisible
()
)
if
(
!
mbInSelectionModeHdl
)
{
mbSelectionMode
=
bMode
;
mpItemView
->
setSelectionMode
(
bMode
);
if
(
mpItemView
->
IsVisible
())
{
mbSelectionMode
=
bMode
;
mpItemView
->
setSelectionMode
(
bMode
);
}
else
ThumbnailView
::
OnSelectionMode
(
bMode
);
}
else
ThumbnailView
::
OnSelectionMode
(
bMode
);
}
IMPL_LINK
(
TemplateAbstractView
,
OverlayItemStateHdl
,
const
ThumbnailViewItem
*
,
pItem
)
...
...
@@ -284,4 +291,16 @@ IMPL_LINK(TemplateAbstractView, OverlayItemStateHdl, const ThumbnailViewItem*, p
return
0
;
}
IMPL_LINK
(
TemplateAbstractView
,
OverlaySelectionModeHdl
,
bool
*
,
pMode
)
{
mbInSelectionModeHdl
=
true
;
setSelectionMode
(
*
pMode
);
if
(
!*
pMode
)
{
deselectOverlayItems
();
}
mbInSelectionModeHdl
=
false
;
return
0
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sfx2/source/control/templatelocalview.cxx
Dosyayı görüntüle @
9bcd98fd
...
...
@@ -702,7 +702,7 @@ bool TemplateLocalView::isTemplateNameUnique(const sal_uInt16 nRegionItemId, con
return
true
;
}
void
TemplateLocalView
::
OnItem
Dbl
Clicked
(
ThumbnailViewItem
*
pRegionItem
)
void
TemplateLocalView
::
OnItemClicked
(
ThumbnailViewItem
*
pRegionItem
)
{
// Fill templates
sal_uInt16
nRegionId
=
pRegionItem
->
mnId
-
1
;
...
...
sfx2/source/control/templateview.cxx
Dosyayı görüntüle @
9bcd98fd
...
...
@@ -208,9 +208,9 @@ void TemplateView::MouseButtonDown (const MouseEvent &rMEvt)
ThumbnailView
::
MouseButtonDown
(
rMEvt
);
}
void
TemplateView
::
OnItem
Dbl
Clicked
(
ThumbnailViewItem
*
pItem
)
void
TemplateView
::
OnItemClicked
(
ThumbnailViewItem
*
pItem
)
{
ma
Dbl
ClickHdl
.
Call
(
pItem
);
maClickHdl
.
Call
(
pItem
);
}
IMPL_LINK_NOARG
(
TemplateView
,
ChangeNameHdl
)
...
...
sfx2/source/control/thumbnailview.cxx
Dosyayı görüntüle @
9bcd98fd
...
...
@@ -202,6 +202,9 @@ void ThumbnailView::DrawItem (ThumbnailViewItem *pItem)
void
ThumbnailView
::
OnSelectionMode
(
bool
bMode
)
{
if
(
!
bMode
)
deselectItems
();
for
(
size_t
i
=
0
,
n
=
mItemList
.
size
();
i
<
n
;
++
i
)
{
mItemList
[
i
]
->
setSelectionMode
(
bMode
);
...
...
@@ -211,7 +214,7 @@ void ThumbnailView::OnSelectionMode (bool bMode)
}
}
void
ThumbnailView
::
OnItem
Dbl
Clicked
(
ThumbnailViewItem
*
)
void
ThumbnailView
::
OnItemClicked
(
ThumbnailViewItem
*
)
{
}
...
...
@@ -508,7 +511,19 @@ IMPL_LINK (ThumbnailView, OnItemSelected, ThumbnailViewItem*, pItem)
void
ThumbnailView
::
MouseButtonDown
(
const
MouseEvent
&
rMEvt
)
{
if
(
rMEvt
.
IsLeft
()
)
bool
bProcessClick
=
rMEvt
.
IsLeft
();
if
(
rMEvt
.
IsRight
(
)
)
{
// Set selection mode with right click
if
(
!
mbSelectionMode
)
{
setSelectionMode
(
true
);
bProcessClick
=
true
;
}
}
if
(
bProcessClick
)
{
ThumbnailViewItem
*
pItem
=
ImplGetItem
(
ImplGetItem
(
rMEvt
.
GetPosPixel
()
)
);
...
...
@@ -530,36 +545,17 @@ void ThumbnailView::MouseButtonDown( const MouseEvent& rMEvt )
else
{
Rectangle
aRect
(
pItem
->
getDrawArea
());
aRect
.
setY
(
aRect
.
getY
()
+
mnItemPadding
+
mnThumbnailHeight
);
aRect
.
SetSize
(
Size
(
mnItemWidth
,
mnDisplayHeight
+
mnItemPadding
));
if
(
aRect
.
IsInside
(
rMEvt
.
GetPosPixel
()))
{
pItem
->
setSelection
(
!
pItem
->
isSelected
());
aRect
.
SetSize
(
Size
(
mnItemWidth
,
mnThumbnailHeight
));
if
(
!
pItem
->
isHighlighted
())
DrawItem
(
pItem
);
maItemStateHdl
.
Call
(
pItem
);
}
//StartTracking( STARTTRACK_SCROLLREPEAT );
if
(
!
mbSelectionMode
&&
aRect
.
IsInside
(
rMEvt
.
GetPosPixel
()))
OnItemClicked
(
pItem
);
}
}
else
if
(
rMEvt
.
GetClicks
()
==
2
)
{
Rectangle
aRect
(
pItem
->
getDrawArea
());
aRect
.
SetSize
(
Size
(
mnItemWidth
,
mnThumbnailHeight
));
if
(
!
mbSelectionMode
&&
aRect
.
IsInside
(
rMEvt
.
GetPosPixel
()))
OnItemDblClicked
(
pItem
);
}
}
return
;
}
}
Control
::
MouseButtonDown
(
rMEvt
);
}
...
...
@@ -1059,8 +1055,8 @@ long ThumbnailView::GetScrollWidth() const
void
ThumbnailView
::
setSelectionMode
(
bool
mode
)
{
mbSelectionMode
=
mode
;
OnSelectionMode
(
mode
);
maSelectionModeHdl
.
Call
(
&
mode
);
}
void
ThumbnailView
::
filterItems
(
const
boost
::
function
<
bool
(
const
ThumbnailViewItem
*
)
>
&
func
)
...
...
sfx2/source/doc/templatedlg.cxx
Dosyayı görüntüle @
9bcd98fd
...
...
@@ -114,6 +114,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
maView
(
new
TemplateLocalView
(
this
,
SfxResId
(
TEMPLATE_VIEW
))),
mpOnlineView
(
new
TemplateRemoteView
(
this
,
WB_VSCROLL
,
false
)),
mbIsSaveMode
(
false
),
mbInSelectionModeHdl
(
false
),
mxDesktop
(
comphelper
::
getProcessServiceFactory
()
->
createInstance
(
"com.sun.star.frame.Desktop"
),
uno
::
UNO_QUERY
)
{
maButtonSelMode
.
SetStyle
(
maButtonSelMode
.
GetStyle
()
|
WB_TOGGLE
);
...
...
@@ -202,8 +203,9 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
maView
->
setItemStateHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
TVFolderStateHdl
));
maView
->
setOverlayItemStateHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
TVTemplateStateHdl
));
maView
->
setOverlay
Dbl
ClickHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
OpenTemplateHdl
));
maView
->
setOverlayClickHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
OpenTemplateHdl
));
maView
->
setOverlayCloseHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
CloseOverlayHdl
));
maView
->
setSelectionModeHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
SelectionModeHdl
));
// Set online view position and dimensions
mpOnlineView
->
SetPosSizePixel
(
aViewPos
,
aThumbSize
);
...
...
@@ -214,9 +216,10 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
TEMPLATE_ITEM_PADDING
);
mpOnlineView
->
setOverlayItemStateHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
TVTemplateStateHdl
));
mpOnlineView
->
setOverlay
Dbl
ClickHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
OpenTemplateHdl
));
mpOnlineView
->
setOverlayClickHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
OpenTemplateHdl
));
mpOnlineView
->
setOverlayCloseHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
CloseOverlayHdl
));
mpOnlineView
->
setOverlayChangeNameHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
RepositoryChangeNameHdl
));
mpOnlineView
->
setSelectionModeHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
SelectionModeHdl
));
mpSearchView
->
SetSizePixel
(
aThumbSize
);
mpSearchView
->
setItemMaxTextLength
(
TEMPLATE_ITEM_MAX_TEXT_LENGTH
);
...
...
@@ -226,6 +229,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
TEMPLATE_ITEM_PADDING
);
mpSearchView
->
setItemStateHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
TVTemplateStateHdl
));
mpSearchView
->
setSelectionModeHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
SelectionModeHdl
));
aButtonAll
.
SetClickHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
ViewAllHdl
));
aButtonDocs
.
SetClickHdl
(
LINK
(
this
,
SfxTemplateManagerDlg
,
ViewDocsHdl
));
...
...
@@ -353,7 +357,16 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg, CloseOverlayHdl)
IMPL_LINK
(
SfxTemplateManagerDlg
,
OnClickSelectionMode
,
ImageButton
*
,
pButton
)
{
maView
->
setSelectionMode
(
pButton
->
GetState
()
==
STATE_CHECK
);
if
(
!
mbInSelectionModeHdl
)
maView
->
setSelectionMode
(
pButton
->
GetState
()
==
STATE_CHECK
);
return
0
;
}
IMPL_LINK
(
SfxTemplateManagerDlg
,
SelectionModeHdl
,
bool
*
,
pMode
)
{
mbInSelectionModeHdl
=
true
;
maButtonSelMode
.
SetState
(
*
pMode
?
STATE_CHECK
:
STATE_NOCHECK
);
mbInSelectionModeHdl
=
false
;
return
0
;
}
...
...
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