summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/inc/utlui.hrc24
-rw-r--r--sw/source/uibase/inc/viewlayoutctrl.hxx1
-rw-r--r--sw/source/uibase/uiview/view2.cxx7
-rw-r--r--sw/source/uibase/utlui/bookctrl.cxx10
-rw-r--r--sw/source/uibase/utlui/statusbar.src43
-rw-r--r--sw/source/uibase/utlui/tmplctrl.cxx6
-rw-r--r--sw/source/uibase/utlui/viewlayoutctrl.cxx28
-rw-r--r--sw/source/uibase/utlui/wordcountctrl.cxx4
8 files changed, 113 insertions, 10 deletions
diff --git a/sw/source/uibase/inc/utlui.hrc b/sw/source/uibase/inc/utlui.hrc
index 9007b886838a..4caa3b387604 100644
--- a/sw/source/uibase/inc/utlui.hrc
+++ b/sw/source/uibase/inc/utlui.hrc
@@ -45,7 +45,15 @@
#define STR_CONTENT_TYPE_INDEX (RC_UTLUI_BEGIN + 17)
#define STR_CONTENT_TYPE_POSTIT (RC_UTLUI_BEGIN + 18)
#define STR_CONTENT_TYPE_DRAWOBJECT (RC_UTLUI_BEGIN + 19)
-#define STR_CONTENT_END (RC_UTLUI_BEGIN + 19)
+// Statusbar: Word count/Viewlayout/Page count
+#define STR_WORDCOUNT_HINT (RC_UTLUI_BEGIN + 20)
+#define STR_VIEWLAYOUT_ONE (RC_UTLUI_BEGIN + 21)
+#define STR_VIEWLAYOUT_TWO (RC_UTLUI_BEGIN + 22)
+#define STR_VIEWLAYOUT_BOOK (RC_UTLUI_BEGIN + 23)
+#define STR_BOOKCTRL_HINT (RC_UTLUI_BEGIN + 24)
+#define STR_BOOKCTRL_HINT_EXTENDED (RC_UTLUI_BEGIN + 25)
+#define STR_TMPLCTRL_HINT (RC_UTLUI_BEGIN + 26)
+#define STR_CONTENT_END (RC_UTLUI_BEGIN + 26)
#define STR_CONTENT_TYPE_SINGLE_FIRST (STR_CONTENT_END + 1)
#define STR_CONTENT_TYPE_SINGLE_OUTLINE (STR_CONTENT_TYPE_SINGLE_FIRST + 0)
@@ -142,13 +150,13 @@
#define IMG_NAVI_ENTRYBMP (RC_UTLUI_BEGIN + 4)
#define ILIST_DB_DLG (RC_UTLUI_BEGIN + 6)
-#define IMG_VIEWLAYOUT_AUTOMATIC (RC_UTLUI_BEGIN + 12)
-#define IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE (RC_UTLUI_BEGIN + 13)
-#define IMG_VIEWLAYOUT_BOOKMODE (RC_UTLUI_BEGIN + 14)
-#define IMG_VIEWLAYOUT_BOOKMODE_ACTIVE (RC_UTLUI_BEGIN + 15)
-#define IMG_VIEWLAYOUT_SINGLECOLUMN (RC_UTLUI_BEGIN + 16)
-#define IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE (RC_UTLUI_BEGIN + 17)
-#define IMG_PAGE_BREAK (RC_UTLUI_BEGIN + 18)
+#define IMG_VIEWLAYOUT_AUTOMATIC (RC_UTLUI_BEGIN + 12)
+#define IMG_VIEWLAYOUT_AUTOMATIC_ACTIVE (RC_UTLUI_BEGIN + 13)
+#define IMG_VIEWLAYOUT_BOOKMODE (RC_UTLUI_BEGIN + 14)
+#define IMG_VIEWLAYOUT_BOOKMODE_ACTIVE (RC_UTLUI_BEGIN + 15)
+#define IMG_VIEWLAYOUT_SINGLECOLUMN (RC_UTLUI_BEGIN + 16)
+#define IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE (RC_UTLUI_BEGIN + 17)
+#define IMG_PAGE_BREAK (RC_UTLUI_BEGIN + 18)
//local ids of the Database ImageLists
#define IMG_COLLAPSE 18002 /*RID_SVXIMG_COLLAPSEDNODE*/
diff --git a/sw/source/uibase/inc/viewlayoutctrl.hxx b/sw/source/uibase/inc/viewlayoutctrl.hxx
index 0816b001eb77..fb47e04263be 100644
--- a/sw/source/uibase/inc/viewlayoutctrl.hxx
+++ b/sw/source/uibase/inc/viewlayoutctrl.hxx
@@ -38,6 +38,7 @@ public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE;
virtual void Paint( const UserDrawEvent& rEvt ) SAL_OVERRIDE;
virtual bool MouseButtonDown( const MouseEvent & ) SAL_OVERRIDE;
+ virtual bool MouseMove( const MouseEvent & ) SAL_OVERRIDE;
};
#endif
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 159941ff4e4e..1625a884a7fc 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1278,9 +1278,16 @@ void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUStr
{
OUString sTemp(GetPageStr( nPhyNum, nVirtNum, rPgStr ));
const SfxStringItem aTmp( FN_STAT_PAGE, sTemp );
+ // Used to distinguish which tooltip to show
+ const SfxBoolItem bExtendedTooltip( FN_STAT_PAGE,
+ !rPgStr.isEmpty() && OUString::number(nPhyNum) != rPgStr
+ && nPhyNum != nVirtNum );
+
SfxBindings &rBnd = GetViewFrame()->GetBindings();
rBnd.SetState( aTmp );
rBnd.Update( FN_STAT_PAGE );
+ rBnd.SetState( bExtendedTooltip );
+ rBnd.Update( FN_STAT_PAGE );
}
void SwView::UpdateDocStats()
diff --git a/sw/source/uibase/utlui/bookctrl.cxx b/sw/source/uibase/utlui/bookctrl.cxx
index e4e5c90c0342..70a913fdb7a5 100644
--- a/sw/source/uibase/utlui/bookctrl.cxx
+++ b/sw/source/uibase/utlui/bookctrl.cxx
@@ -18,6 +18,8 @@
*/
#include "hintids.hxx"
+#include <swtypes.hxx>
+#include <utlui.hrc>
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
@@ -79,6 +81,14 @@ void SwBookmarkControl::StateChanged(
sPageNumber = ((SfxStringItem*)pState)->GetValue();
GetStatusBar().SetItemText( GetId(), sPageNumber );
}
+ else if ( pState->ISA( SfxBoolItem ) )
+ {
+ if (((SfxBoolItem*)pState)->GetValue()) // Indicates whether to show extended tooltip
+ GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_BOOKCTRL_HINT_EXTENDED));
+ else
+ GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_BOOKCTRL_HINT));
+ }
+
}
void SwBookmarkControl::Paint( const UserDrawEvent& )
diff --git a/sw/source/uibase/utlui/statusbar.src b/sw/source/uibase/utlui/statusbar.src
new file mode 100644
index 000000000000..dcb5bbab26e4
--- /dev/null
+++ b/sw/source/uibase/utlui/statusbar.src
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#include <utlui.hrc>
+
+String STR_WORDCOUNT_HINT
+{
+ Text [ en-US ] = "Word and character count. Click for more extensive stats";
+};
+String STR_VIEWLAYOUT_ONE
+{
+ Text [ en-US ] = "Single page view";
+};
+
+String STR_VIEWLAYOUT_TWO
+{
+ Text [ en-US ] = "Two page view";
+};
+
+String STR_VIEWLAYOUT_BOOK
+{
+ Text [ en-US ] = "Book view";
+};
+String STR_BOOKCTRL_HINT
+{
+ Text [ en-US ] = "Page number/Total pages. Click to show Navigator";
+};
+String STR_BOOKCTRL_HINT_EXTENDED
+{
+ Text [ en-US ] = "Document page number/Total pages (Print page number). Click to show Navigator";
+};
+String STR_TMPLCTRL_HINT
+{
+ Text [ en-US ] = "Page Style. Right-click to change style and click to modify style";
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/utlui/tmplctrl.cxx b/sw/source/uibase/utlui/tmplctrl.cxx
index a22c112f24c8..1046b05294c6 100644
--- a/sw/source/uibase/utlui/tmplctrl.cxx
+++ b/sw/source/uibase/utlui/tmplctrl.cxx
@@ -23,6 +23,9 @@
#include <sfx2/dispatch.hxx>
#include <vcl/status.hxx>
+#include <swtypes.hxx>
+#include <utlui.hrc>
+
#include "wrtsh.hxx"
#include "view.hxx"
#include "swmodule.hxx"
@@ -56,13 +59,12 @@ void SwTemplatePopup_Impl::Select()
nCurId = GetCurItemId();
}
-// class SvxZoomStatusBarControl
-
SwTemplateControl::SwTemplateControl( sal_uInt16 _nSlotId,
sal_uInt16 _nId,
StatusBar& rStb ) :
SfxStatusBarControl( _nSlotId, _nId, rStb )
{
+ GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_TMPLCTRL_HINT));
}
SwTemplateControl::~SwTemplateControl()
diff --git a/sw/source/uibase/utlui/viewlayoutctrl.cxx b/sw/source/uibase/utlui/viewlayoutctrl.cxx
index bc58ff865d91..b3204ee4bbc8 100644
--- a/sw/source/uibase/utlui/viewlayoutctrl.cxx
+++ b/sw/source/uibase/utlui/viewlayoutctrl.cxx
@@ -191,4 +191,32 @@ bool SwViewLayoutControl::MouseButtonDown( const MouseEvent & rEvt )
return true;
}
+bool SwViewLayoutControl::MouseMove( const MouseEvent & rEvt )
+{
+ const Rectangle aRect = getControlRect();
+ const Point aPoint = rEvt.GetPosPixel();
+ const long nXDiff = aPoint.X() - aRect.Left();
+
+ const long nImageWidthSingle = mpImpl->maImageSingleColumn.GetSizePixel().Width();
+ const long nImageWidthAuto = mpImpl->maImageAutomatic.GetSizePixel().Width();
+ const long nImageWidthBook = mpImpl->maImageBookMode.GetSizePixel().Width();
+ const long nImageWidthSum = nImageWidthSingle + nImageWidthAuto + nImageWidthBook;
+
+ const long nXOffset = (aRect.GetWidth() - nImageWidthSum)/2;
+
+ if ( nXDiff < nXOffset + nImageWidthSingle )
+ {
+ GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_VIEWLAYOUT_ONE));
+ }
+ else if ( nXDiff < nXOffset + nImageWidthSingle + nImageWidthAuto )
+ {
+ GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_VIEWLAYOUT_TWO));
+ }
+ else
+ {
+ GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_VIEWLAYOUT_BOOK));
+ }
+ return true;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/utlui/wordcountctrl.cxx b/sw/source/uibase/utlui/wordcountctrl.cxx
index 3d3ac34f8e87..58fe4b40db37 100644
--- a/sw/source/uibase/utlui/wordcountctrl.cxx
+++ b/sw/source/uibase/utlui/wordcountctrl.cxx
@@ -7,6 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <swtypes.hxx>
+#include <utlui.hrc>
#include "wordcountctrl.hxx"
#include <svl/stritem.hxx>
@@ -29,6 +31,8 @@ void SwWordCountStatusBarControl::StateChanged(
{
if (eState == SfxItemState::DEFAULT) // Can access pState
GetStatusBar().SetItemText( GetId(), ((SfxStringItem*)pState)->GetValue() );
+
+ GetStatusBar().SetQuickHelpText(GetId(), SW_RESSTR(STR_WORDCOUNT_HINT));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */