diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-10-10 15:09:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-10-11 15:32:14 +0100 |
commit | 33603a582bdd173a8e85c78bb0e8ef82874b8e59 (patch) | |
tree | 863593b5516b61ca37122ea566087bea8744e830 | |
parent | 51e5e4970bda753faf7403cbf3c68ded3ed7a71f (diff) |
convert writer navigator to .ui format
Change-Id: I83f834ea050372362b50de61753c2b3e33c67778
-rw-r--r-- | extras/source/glade/libreoffice-catalog.xml.in | 5 | ||||
-rw-r--r-- | sc/source/ui/inc/content.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/navipi/content.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/navipi/navipi.cxx | 18 | ||||
-rw-r--r-- | sw/UIConfig_swriter.mk | 1 | ||||
-rw-r--r-- | sw/inc/cmdid.h | 29 | ||||
-rw-r--r-- | sw/inc/helpid.h | 29 | ||||
-rw-r--r-- | sw/source/uibase/inc/conttree.hxx | 18 | ||||
-rw-r--r-- | sw/source/uibase/inc/navipi.hxx | 33 | ||||
-rw-r--r-- | sw/source/uibase/inc/utlui.hrc | 5 | ||||
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 262 | ||||
-rw-r--r-- | sw/source/uibase/utlui/glbltree.cxx | 81 | ||||
-rw-r--r-- | sw/source/uibase/utlui/navipi.cxx | 801 | ||||
-rw-r--r-- | sw/source/uibase/utlui/navipi.hrc | 2 | ||||
-rw-r--r-- | sw/source/uibase/utlui/navipi.src | 294 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/navigatorpanel.ui | 487 |
16 files changed, 1074 insertions, 997 deletions
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index ecb5b943fc52..3dc6c1b9f31c 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -745,6 +745,11 @@ <glade-widget-class title="Sidebar ToolBox" name="sfxlo-SidebarToolBox" generic-name="Sidebar ToolBox" parent="GtkToolbar" icon-name="widget-gtk-toolbar"/> + + <glade-widget-class title="Writer Navigator ToolBox" name="swlo-SwNavHelpToolBox" + generic-name="Writer Navigator ToolBox" parent="GtkToolbar" + icon-name="widget-gtk-toolbar"/> + <glade-widget-class title="Tab Stop Images" name="cuilo-TabWin_Impl" generic-name="TabWin_Impl" parent="GtkDrawingArea" icon-name="widget-gtk-drawingarea"/> diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx index 4c60d15b2712..4a673c79997a 100644 --- a/sc/source/ui/inc/content.hxx +++ b/sc/source/ui/inc/content.hxx @@ -129,6 +129,7 @@ public: void SetNavigatorDlgFlag(bool isInNavigateDlg){ bisInNavigatoeDlg=isInNavigateDlg;}; virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; virtual void KeyInput( const KeyEvent& rKEvt ) override; + virtual Size GetOptimalSize() const override; void InitWindowBits( bool bButtons ); diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index b309d592a017..fd5bb59af9d4 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -134,6 +134,11 @@ ScContentTree::ScContentTree(vcl::Window* pParent, ScNavigatorDlg* pNavigatorDlg pTmpEntry= nullptr; } +Size ScContentTree::GetOptimalSize() const +{ + return LogicToPixel(Size(110, 100), MapUnit::MapAppFont); +} + ScContentTree::~ScContentTree() { disposeOnce(); diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index 2443250c133a..e3782a5010c0 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -83,11 +83,7 @@ ColumnEdit::~ColumnEdit() disposeOnce(); } -VCL_BUILDER_DECL_FACTORY(ColumnEdit) -{ - (void)rMap; - rRet = VclPtr<ColumnEdit>::Create(pParent, WB_BORDER | WB_SPIN | WB_REPEAT | WB_RIGHT); -} +VCL_BUILDER_FACTORY_ARGS(ColumnEdit, WB_BORDER | WB_SPIN | WB_REPEAT | WB_RIGHT) bool ColumnEdit::Notify( NotifyEvent& rNEvt ) { @@ -264,11 +260,7 @@ RowEdit::~RowEdit() disposeOnce(); } -VCL_BUILDER_DECL_FACTORY(RowEdit) -{ - (void)rMap; - rRet = VclPtr<RowEdit>::Create(pParent, WB_BORDER | WB_SPIN | WB_REPEAT | WB_RIGHT); -} +VCL_BUILDER_FACTORY_ARGS(RowEdit, WB_BORDER | WB_SPIN | WB_REPEAT | WB_RIGHT) bool RowEdit::Notify( NotifyEvent& rNEvt ) { @@ -417,9 +409,9 @@ void ScNavigatorDlg::UpdateButtons() aTbxCmd->SetItemImage(nDragModeId, Image(ScResId(nImageId))); } -ScNavigatorSettings::ScNavigatorSettings() : - mnRootSelected( ScContentId::ROOT ), - mnChildSelected( SC_CONTENT_NOCHILD ) +ScNavigatorSettings::ScNavigatorSettings() + : mnRootSelected(ScContentId::ROOT) + , mnChildSelected(SC_CONTENT_NOCHILD) { } diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index 7e7e649629e1..2ff017fe3b6a 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -204,6 +204,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/mmselectpage \ sw/uiconfig/swriter/ui/mmsendmails \ sw/uiconfig/swriter/ui/mmsalutationpage \ + sw/uiconfig/swriter/ui/navigatorpanel \ sw/uiconfig/swriter/ui/notebookbar \ sw/uiconfig/swriter/ui/notebookbar_groups \ sw/uiconfig/swriter/ui/notebookbar_single \ diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index 30eb2f49f964..b3451c9d4168 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -115,24 +115,10 @@ #define FN_NEXT_BOOKMARK (FN_EDIT + 68) /* */ #define FN_PREV_BOOKMARK (FN_EDIT + 69) /* */ -/*Navigator ToolBoxes*/ -#define FN_ITEM_DOWN (FN_EDIT + 71) /**/ -#define FN_ITEM_LEFT (FN_EDIT + 72) /**/ -#define FN_ITEM_RIGHT (FN_EDIT + 73) /**/ -#define FN_ITEM_UP (FN_EDIT + 74) /**/ -#define FN_DOWN (FN_EDIT + 75) /**/ - -#define FN_SELECT_FOOTER (FN_EDIT + 77) /**/ -#define FN_SELECT_HEADER (FN_EDIT + 79) /**/ #define FN_PAGENUMBER (FN_EDIT + 80) /**/ -#define FN_SELECT_FOOTNOTE (FN_EDIT + 82) /**/ -#define FN_SELECT_SET_AUTO_BOOKMARK (FN_EDIT + 83) /**/ -#define FN_UP (FN_EDIT + 86) /**/ #define FN_SELECT_PARA (FN_EDIT + 97) /* select paragraph*/ -#define FN_SELECT_CONTENT (FN_EDIT + 99) /* Navigator - Content Type */ - #define FN_UPDATE_ALL_LINKS (FN_EDIT2 + 24) /* update all links */ #define FN_REDLINE_SHOW (FN_EDIT2 + 26) /* show Redlining */ @@ -178,28 +164,13 @@ #define FN_SET_PAGE (FN_VIEW + 29) /* Set page template to paragraph */ -// more Navigator -#define FN_SHOW_CONTENT_BOX (FN_VIEW + 33) /**/ -#define FN_SHOW_ROOT (FN_VIEW + 34) /**/ -#define FN_DROP_REGION (FN_VIEW + 35) /**/ -#define FN_OUTLINE_LEVEL (FN_VIEW + 36) /**/ - #define FN_PRINT_LAYOUT (FN_VIEW + 37) /* print layout */ -#define FN_DROP_REGION_LINK (FN_VIEW + 38) /**/ -#define FN_DROP_REGION_COPY (FN_VIEW + 39) /**/ - #define FN_SCROLL_NAVIGATION (FN_VIEW + 40) /* Navigation Controller */ #define FN_VIEW_HIDDEN_PARA (FN_VIEW + 42) /* View hidden paragraphs */ #define FN_VIEW_SMOOTH_SCROLL (FN_VIEW + 43) -#define FN_GLOBAL_SWITCH (FN_VIEW + 44) /* Toggle between Global and Content */ -#define FN_GLOBAL_EDIT (FN_VIEW + 45) /* edit */ -#define FN_GLOBAL_UPDATE (FN_VIEW + 46) /* update */ -#define FN_GLOBAL_OPEN (FN_VIEW + 47) /* open */ -#define FN_GLOBAL_SAVE_CONTENT (FN_VIEW + 48) /* save content of link */ -#define FN_CREATE_NAVIGATION (FN_VIEW + 49) /* create Navigations-Controller */ #define FN_PREVIEW_ZOOM (FN_VIEW + 51) /* create table controller for zoom */ #define FN_SET_MODOPT_TBLNUMFMT (FN_VIEW + 52) /* Number recognition in tables */ diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index cc9fd26cf284..65833135e7fd 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -43,30 +43,7 @@ #define HID_NAVIGATOR_TREELIST "SW_HID_NAVIGATOR_TREELIST" #define HID_NAVIGATOR_TOOLBOX "SW_HID_NAVIGATOR_TOOLBOX" #define HID_NAVIGATOR_LISTBOX "SW_HID_NAVIGATOR_LISTBOX" -#define HID_NAVI_TBX2 "SW_HID_NAVI_TBX2" -#define HID_NAVI_TBX3 "SW_HID_NAVI_TBX3" -#define HID_NAVI_TBX4 "SW_HID_NAVI_TBX4" -#define HID_NAVI_TBX5 "SW_HID_NAVI_TBX5" -#define HID_NAVI_TBX6 "SW_HID_NAVI_TBX6" -#define HID_NAVI_TBX7 "SW_HID_NAVI_TBX7" -#define HID_NAVI_TBX8 "SW_HID_NAVI_TBX8" -#define HID_NAVI_TBX9 "SW_HID_NAVI_TBX9" -#define HID_NAVI_TBX10 "SW_HID_NAVI_TBX10" -#define HID_NAVI_TBX11 "SW_HID_NAVI_TBX11" -#define HID_NAVI_TBX12 "SW_HID_NAVI_TBX12" -#define HID_NAVI_TBX13 "SW_HID_NAVI_TBX13" -#define HID_NAVI_TBX14 "SW_HID_NAVI_TBX14" -#define HID_NAVI_TBX15 "SW_HID_NAVI_TBX15" #define HID_NAVI_VS "SW_HID_NAVI_VS" -#define HID_NAVI_TBX16 "SW_HID_NAVI_TBX16" -#define HID_NAVI_TBX17 "SW_HID_NAVI_TBX17" -#define HID_NAVI_TBX18 "SW_HID_NAVI_TBX18" -#define HID_NAVI_TBX19 "SW_HID_NAVI_TBX19" -#define HID_NAVI_TBX20 "SW_HID_NAVI_TBX20" -#define HID_NAVI_TBX21 "SW_HID_NAVI_TBX21" -#define HID_NAVI_TBX22 "SW_HID_NAVI_TBX22" -#define HID_NAVI_TBX23 "SW_HID_NAVI_TBX23" -#define HID_NAVI_TBX24 "SW_HID_NAVI_TBX24" #define HID_NAVIGATOR_GLOBAL_TOOLBOX "SW_HID_NAVIGATOR_GLOBAL_TOOLBOX" #define HID_NAVIGATOR_GLOB_TREELIST "SW_HID_NAVIGATOR_GLOB_TREELIST" #define HID_GLBLTREE_UPDATE "SW_HID_GLBLTREE_UPDATE" @@ -81,8 +58,6 @@ #define HID_GLBLTREE_UPD_IDX "SW_HID_GLBLTREE_UPD_IDX" #define HID_GLBLTREE_UPD_LINK "SW_HID_GLBLTREE_UPD_LINK" #define HID_GLBLTREEUPD_ALL "SW_HID_GLBLTREEUPD_ALL" -#define HID_NAVI_CONTENT "SW_HID_NAVI_CONTENT" -#define HID_NAVI_GLOBAL "SW_HID_NAVI_GLOBAL" #define HID_SORT_ACTION "SW_HID_SORT_ACTION" #define HID_SORT_AUTHOR "SW_HID_SORT_AUTHOR" #define HID_SORT_DATE "SW_HID_SORT_DATE" @@ -172,13 +147,9 @@ // More Help-IDs #define HID_EDIT_FORMULA "SW_HID_EDIT_FORMULA" -#define HID_NAVIGATION_PI "SW_HID_NAVIGATION_PI" - #define HID_CALC_TOOLBOX "SW_HID_CALC_TOOLBOX" - - #define HID_AUTOFORMAT_REJECT "SW_HID_AUTOFORMAT_REJECT" #define HID_AUTOFORMAT_ACCEPT "SW_HID_AUTOFORMAT_ACCEPT" #define HID_AUTOFORMAT_EDIT_CHG "SW_HID_AUTOFORMAT_EDIT_CHG" diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index 9598b76e6999..3afdd3e135d5 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -55,6 +55,7 @@ class SwContentTree : public SvTreeListBox , public SfxListener { + VclPtr<SwNavigationPI> m_xDialog; ImageList m_aEntryImages; OUString m_sSpace; AutoTimer m_aUpdTimer; @@ -156,7 +157,7 @@ protected: virtual void ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) override; public: - SwContentTree(vcl::Window* pParent, const ResId& rResId); + SwContentTree(vcl::Window* pParent, SwNavigationPI* pDialog); virtual ~SwContentTree() override; virtual void dispose() override; OUString GetEntryAltText( SvTreeListEntry* pEntry ) const override; @@ -199,7 +200,7 @@ public: virtual bool Collapse( SvTreeListEntry* pParent ) override; /** Execute commands of the Navigator */ - void ExecCommand(sal_uInt16 nCmd, bool bModifier); + void ExecCommand(const OUString& rCmd, bool bModifier); void ShowTree(); /** folded together will not be glidled */ @@ -221,6 +222,7 @@ public: virtual void KeyInput(const KeyEvent& rKEvt) override; virtual bool Select( SvTreeListEntry* pEntry, bool bSelect=true ) override; + virtual Size GetOptimalSize() const override; using Control::Notify; // FIXME why do we have 2 of these virtual void Notify(SfxBroadcaster& rBC, SfxHint const& rHint) override; @@ -247,10 +249,11 @@ namespace sfx2 { class FileDialogHelper; } class SwGlobalTree : public SvTreeListBox { private: - AutoTimer aUpdateTimer; - OUString aContextStrings[GLOBAL_CONTEXT_COUNT]; + VclPtr<SwNavigationPI> xDialog; + AutoTimer aUpdateTimer; + OUString aContextStrings[GLOBAL_CONTEXT_COUNT]; - ImageList aEntryImages; + ImageList aEntryImages; SwWrtShell* pActiveShell; SvTreeListEntry* pEmphasisEntry; // Drag'n Drop emphasis @@ -330,9 +333,10 @@ protected: virtual void ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) override; public: - SwGlobalTree(vcl::Window* pParent, const ResId& rResId); + SwGlobalTree(vcl::Window* pParent, SwNavigationPI* pDialog); virtual ~SwGlobalTree() override; virtual void dispose() override; + virtual Size GetOptimalSize() const override; void TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox); void InsertRegion( const SwGlblDocContent* pCont, @@ -342,7 +346,7 @@ public: void ShowTree(); void HideTree(); - void ExecCommand(sal_uInt16 nCmd); + void ExecCommand(const OUString& rCmd); void Display(bool bOnlyUpdateUserData = false); diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx index 6c93a1b9467a..503c1d7da878 100644 --- a/sw/source/uibase/inc/navipi.hxx +++ b/sw/source/uibase/inc/navipi.hxx @@ -27,6 +27,7 @@ #include <sfx2/childwin.hxx> #include <sfx2/ctrlitem.hxx> #include <sfx2/tbxctrl.hxx> +#include <svx/sidebar/PanelLayout.hxx> #include <conttree.hxx> class SwWrtShell; @@ -38,20 +39,26 @@ class SwView; class SwNavigationConfig; class SfxObjectShellLock; class SfxChildWindowContext; -class SwNavigationPI; enum class RegionMode; class SpinField; class SwNavHelpToolBox : public ToolBox { + VclPtr<SwNavigationPI> m_xDialog; virtual void MouseButtonDown(const MouseEvent &rEvt) override; virtual void RequestHelp( const HelpEvent& rHEvt ) override; - public: - SwNavHelpToolBox(SwNavigationPI* pParent, const ResId &rResId); + virtual void dispose() override; +public: + SwNavHelpToolBox(Window* pParent); + void SetDialog(SwNavigationPI* pDialog) + { + m_xDialog = pDialog; + } + ~SwNavHelpToolBox() override; }; -class SwNavigationPI : public vcl::Window, - public SfxControllerItem, public SfxListener +class SwNavigationPI : public PanelLayout, + public SfxControllerItem, public SfxListener { friend class SwNavigationChild; friend class SwContentTree; @@ -59,8 +66,10 @@ class SwNavigationPI : public vcl::Window, VclPtr<SwNavHelpToolBox> m_aContentToolBox; VclPtr<ToolBox> m_aGlobalToolBox; - ImageList m_aContentImageList; + VclPtr<NumEditAction> m_xEdit; + VclPtr<VclContainer> m_aContentBox; VclPtr<SwContentTree> m_aContentTree; + VclPtr<VclContainer> m_aGlobalBox; VclPtr<SwGlobalTree> m_aGlobalTree; VclPtr<ListBox> m_aDocListBox; Idle m_aPageChgIdle; @@ -81,13 +90,9 @@ class SwNavigationPI : public vcl::Window, SwNavigationConfig *m_pConfig; SfxBindings &m_rBindings; - long m_nDocLBIniHeight; - long m_nWishWidth; sal_uInt16 m_nAutoMarkIdx; RegionMode m_nRegionMode; // 0 - URL, 1 - region with link 2 - region without link - short m_nZoomIn; - short m_nZoomOutInit; - short m_nZoomOut; + Size m_aExpandedSize; bool m_bIsZoomedIn : 1; bool m_bPageCtrlsVisible : 1; @@ -114,7 +119,6 @@ class SwNavigationPI : public vcl::Window, DECL_LINK( ClosePopupWindow, SfxPopupWindow *, void ); void UsePage(); - void InitImageList(); void SetPopupWindow( SfxPopupWindow* ); using Window::Notify; @@ -122,14 +126,11 @@ class SwNavigationPI : public vcl::Window, protected: - virtual void Resize() override; - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; - // release ObjectShellLock early enough for app end virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; NumEditAction& GetPageEdit(); - bool ToggleTree(); + void ToggleTree(); void SetGlobalMode(bool bSet) {m_bGlobalMode = bSet;} public: diff --git a/sw/source/uibase/inc/utlui.hrc b/sw/source/uibase/inc/utlui.hrc index 7285dfaf6b77..6789d2ab4d71 100644 --- a/sw/source/uibase/inc/utlui.hrc +++ b/sw/source/uibase/inc/utlui.hrc @@ -145,8 +145,6 @@ #define RES_FRMEX_MENU (STR_AUTH_FIELD_END + 1) -#define DLG_NAVIGATION_PI (RC_UTLUI_BEGIN + 1) - #define IMG_NAVI_ENTRYBMP (RC_UTLUI_BEGIN + 4) #define ILIST_DB_DLG (RC_UTLUI_BEGIN + 6) @@ -157,6 +155,9 @@ #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 RID_IMG_DROP_REGION (RC_UTLUI_BEGIN + 19) +#define RID_IMG_DROP_LINK (RC_UTLUI_BEGIN + 20) +#define RID_IMG_DROP_COPY (RC_UTLUI_BEGIN + 21) //local ids of the Database ImageLists #define IMG_COLLAPSE 18002 /*RID_SVXIMG_COLLAPSEDNODE*/ diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 48a21a981099..cb3c75d29566 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -766,8 +766,9 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) } -SwContentTree::SwContentTree(vcl::Window* pParent, const ResId& rResId) - : SvTreeListBox(pParent, rResId) +SwContentTree::SwContentTree(vcl::Window* pParent, SwNavigationPI* pDialog) + : SvTreeListBox(pParent) + , m_xDialog(pDialog) , m_sSpace(OUString(" ")) , m_sRemoveIdx(SW_RES(STR_REMOVE_INDEX)) , m_sUpdateIdx(SW_RES(STR_UPDATE)) @@ -833,9 +834,15 @@ void SwContentTree::dispose() bIsInDrag = false; m_aUpdTimer.Stop(); SetActiveShell(nullptr); + m_xDialog.clear(); SvTreeListBox::dispose(); } +Size SwContentTree::GetOptimalSize() const +{ + return LogicToPixel(Size(110, 112), MapUnit::MapAppFont); +} + OUString SwContentTree::GetEntryAltText( SvTreeListEntry* pEntry ) const { if( pEntry == nullptr) @@ -1564,11 +1571,11 @@ void SwContentTree::Display( bool bActive ) m_bIsLastReadOnly = bReadOnly; bool bDisable = pShell == nullptr || bReadOnly; SwNavigationPI* pNavi = GetParentWindow(); - pNavi->m_aContentToolBox->EnableItem(FN_ITEM_UP , !bDisable); - pNavi->m_aContentToolBox->EnableItem(FN_ITEM_DOWN, !bDisable); - pNavi->m_aContentToolBox->EnableItem(FN_ITEM_LEFT, !bDisable); - pNavi->m_aContentToolBox->EnableItem(FN_ITEM_RIGHT, !bDisable); - pNavi->m_aContentToolBox->EnableItem(FN_SELECT_SET_AUTO_BOOKMARK, !bDisable); + pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("up"), !bDisable); + pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("down"), !bDisable); + pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("promote"), !bDisable); + pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("demote"), !bDisable); + pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("reminder"), !bDisable); } if(pShell) { @@ -1890,7 +1897,8 @@ void SwContentTree::ToggleToRoot() } } m_pConfig->SetRootType( m_nRootType ); - GetParentWindow()->m_aContentToolBox->CheckItem(FN_SHOW_ROOT, m_bIsRoot); + VclPtr<SwNavHelpToolBox> xBox = GetParentWindow()->m_aContentToolBox; + xBox->CheckItem(xBox->GetItemId("root"), m_bIsRoot); } bool SwContentTree::HasContentChanged() @@ -2218,147 +2226,143 @@ void SwContentTree::Notify(SfxBroadcaster & rBC, SfxHint const& rHint) } } -void SwContentTree::ExecCommand(sal_uInt16 nCmd, bool bModifier) +void SwContentTree::ExecCommand(const OUString& rCmd, bool bModifier) { - bool bMove = false; - switch( nCmd ) + const bool bUp = rCmd == "up"; + const bool bUpDown = bUp || rCmd == "up"; + const bool bLeft = rCmd == "promote"; + const bool bLeftRight = bLeft || rCmd == "demote"; + if (!bUpDown && !bLeftRight) + return; + if( !GetWrtShell()->GetView().GetDocShell()->IsReadOnly() && + (m_bIsActive || + (m_bIsConstant && m_pActiveShell == GetParentWindow()->GetCreateView()->GetWrtShellPtr()))) { - case FN_ITEM_DOWN: - case FN_ITEM_UP: - bMove = true; - SAL_FALLTHROUGH; - case FN_ITEM_LEFT: - case FN_ITEM_RIGHT: - if( !GetWrtShell()->GetView().GetDocShell()->IsReadOnly() && - (m_bIsActive || - (m_bIsConstant && m_pActiveShell == GetParentWindow()->GetCreateView()->GetWrtShellPtr()))) + SwWrtShell* pShell = GetWrtShell(); + sal_Int8 nActOutlineLevel = m_nOutlineLevel; + sal_uInt16 nActPos = pShell->GetOutlinePos(nActOutlineLevel); + SvTreeListEntry* pFirstEntry = FirstSelected(); + if (pFirstEntry && lcl_IsContent(pFirstEntry)) { - SwWrtShell* pShell = GetWrtShell(); - sal_Int8 nActOutlineLevel = m_nOutlineLevel; - sal_uInt16 nActPos = pShell->GetOutlinePos(nActOutlineLevel); - SvTreeListEntry* pFirstEntry = FirstSelected(); - if (pFirstEntry && lcl_IsContent(pFirstEntry)) - { - if ( (m_bIsRoot && m_nRootType == ContentTypeId::OUTLINE) || - static_cast<SwContent*>(pFirstEntry->GetUserData())->GetParent()->GetType() - == ContentTypeId::OUTLINE) - { - nActPos = static_cast<SwOutlineContent*>(pFirstEntry->GetUserData())->GetPos(); - } + if ( (m_bIsRoot && m_nRootType == ContentTypeId::OUTLINE) || + static_cast<SwContent*>(pFirstEntry->GetUserData())->GetParent()->GetType() + == ContentTypeId::OUTLINE) + { + nActPos = static_cast<SwOutlineContent*>(pFirstEntry->GetUserData())->GetPos(); } - if ( nActPos < USHRT_MAX && - ( !bMove || pShell->IsOutlineMovable( nActPos )) ) + } + if ( nActPos < USHRT_MAX && + ( !bUpDown || pShell->IsOutlineMovable( nActPos )) ) + { + pShell->StartAllAction(); + pShell->GotoOutline( nActPos); // If text selection != box selection + pShell->Push(); + pShell->MakeOutlineSel( nActPos, nActPos, + bModifier); + if (bUpDown) { - pShell->StartAllAction(); - pShell->GotoOutline( nActPos); // If text selection != box selection - pShell->Push(); - pShell->MakeOutlineSel( nActPos, nActPos, - bModifier); - if( bMove ) + short nDir = bUp ? -1 : 1; + if( !bModifier && ( (nDir == -1 && nActPos > 0) || + (nDir == 1 && nActPos < GetEntryCount() - 2) ) ) { - short nDir = nCmd == FN_ITEM_UP ? -1 : 1; - if( !bModifier && ( (nDir == -1 && nActPos > 0) || - (nDir == 1 && nActPos < GetEntryCount() - 2) ) ) + pShell->MoveOutlinePara( nDir ); + // Set cursor back to the current position + pShell->GotoOutline( nActPos + nDir); + } + else if(bModifier && pFirstEntry) + { + sal_uInt16 nActEndPos = nActPos; + SvTreeListEntry* pEntry = pFirstEntry; + const auto nActLevel = static_cast<SwOutlineContent*>( + pFirstEntry->GetUserData())->GetOutlineLevel(); + pEntry = Next(pEntry); + while( pEntry && CTYPE_CNT == + static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId() ) { - pShell->MoveOutlinePara( nDir ); - // Set cursor back to the current position - pShell->GotoOutline( nActPos + nDir); + if(nActLevel >= static_cast<SwOutlineContent*>( + pEntry->GetUserData())->GetOutlineLevel()) + break; + pEntry = Next(pEntry); + nActEndPos++; } - else if(bModifier && pFirstEntry) + if(nDir == 1) { - sal_uInt16 nActEndPos = nActPos; - SvTreeListEntry* pEntry = pFirstEntry; - const auto nActLevel = static_cast<SwOutlineContent*>( - pFirstEntry->GetUserData())->GetOutlineLevel(); - pEntry = Next(pEntry); - while( pEntry && CTYPE_CNT == - static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId() ) + // If the last entry is to be moved it is over! + if(pEntry && CTYPE_CNT == + static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId()) { - if(nActLevel >= static_cast<SwOutlineContent*>( - pEntry->GetUserData())->GetOutlineLevel()) - break; - pEntry = Next(pEntry); - nActEndPos++; - } - if(nDir == 1) - { - // If the last entry is to be moved it is over! - if(pEntry && CTYPE_CNT == - static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId()) + // pEntry now points to the following entry of the last + // selected entry. + sal_uInt16 nDest = nActEndPos + 1; + // here needs to found the next record after next. + // The selection must be inserted in front of. + while(pEntry ) { - // pEntry now points to the following entry of the last - // selected entry. - sal_uInt16 nDest = nActEndPos + 1; - // here needs to found the next record after next. - // The selection must be inserted in front of. - while(pEntry ) + pEntry = Next(pEntry); + // nDest++ may only executed if pEntry != 0 + if(pEntry && nDest++ && + ( nActLevel >= static_cast<SwOutlineContent*>(pEntry->GetUserData())->GetOutlineLevel()|| + CTYPE_CNT != static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId())) { - pEntry = Next(pEntry); - // nDest++ may only executed if pEntry != 0 - if(pEntry && nDest++ && - ( nActLevel >= static_cast<SwOutlineContent*>(pEntry->GetUserData())->GetOutlineLevel()|| - CTYPE_CNT != static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId())) - { - nDest--; - break; - } + nDest--; + break; } - nDir = nDest - nActEndPos; - // If no entry was found which corresponds the condition - // of the previously paste, it needs to be pushed slightly less. } - else - nDir = 0; + nDir = nDest - nActEndPos; + // If no entry was found which corresponds the condition + // of the previously paste, it needs to be pushed slightly less. } else + nDir = 0; + } + else + { + sal_uInt16 nDest = nActPos; + pEntry = pFirstEntry; + while(pEntry && nDest ) { - sal_uInt16 nDest = nActPos; - pEntry = pFirstEntry; - while(pEntry && nDest ) + nDest--; + pEntry = Prev(pEntry); + if(pEntry && + (nActLevel >= static_cast<SwOutlineContent*>(pEntry->GetUserData())->GetOutlineLevel()|| + CTYPE_CNT != static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId())) { - nDest--; - pEntry = Prev(pEntry); - if(pEntry && - (nActLevel >= static_cast<SwOutlineContent*>(pEntry->GetUserData())->GetOutlineLevel()|| - CTYPE_CNT != static_cast<SwTypeNumber*>(pEntry->GetUserData())->GetTypeId())) - { - break; - } + break; } - nDir = nDest - nActPos; - } - if(nDir) - { - pShell->MoveOutlinePara( nDir ); - //Set cursor back to the current position - pShell->GotoOutline( nActPos + nDir); } + nDir = nDest - nActPos; + } + if(nDir) + { + pShell->MoveOutlinePara( nDir ); + //Set cursor back to the current position + pShell->GotoOutline( nActPos + nDir); } } - else - { - if( !pShell->IsProtectedOutlinePara() ) - pShell->OutlineUpDown( nCmd == FN_ITEM_LEFT ? -1 : 1 ); - } + } + else + { + if( !pShell->IsProtectedOutlinePara() ) + pShell->OutlineUpDown(bLeft ? -1 : 1); + } - pShell->ClearMark(); - pShell->Pop(false); // Cursor is now back at the current superscription. - pShell->EndAllAction(); - if(m_aActiveContentArr[ContentTypeId::OUTLINE]) - m_aActiveContentArr[ContentTypeId::OUTLINE]->Invalidate(); - Display(true); - if(!m_bIsRoot) - { - const sal_uInt16 nCurrPos = pShell->GetOutlinePos(MAXLEVEL); - SvTreeListEntry* pFirst = First(); + pShell->ClearMark(); + pShell->Pop(false); // Cursor is now back at the current superscription. + pShell->EndAllAction(); + if(m_aActiveContentArr[ContentTypeId::OUTLINE]) + m_aActiveContentArr[ContentTypeId::OUTLINE]->Invalidate(); + Display(true); + if(!m_bIsRoot) + { + const sal_uInt16 nCurrPos = pShell->GetOutlinePos(MAXLEVEL); + SvTreeListEntry* pFirst = First(); - while( nullptr != (pFirst = Next(pFirst)) && lcl_IsContent(pFirst)) + while( nullptr != (pFirst = Next(pFirst)) && lcl_IsContent(pFirst)) + { + if(static_cast<SwOutlineContent*>(pFirst->GetUserData())->GetPos() == nCurrPos) { - if(static_cast<SwOutlineContent*>(pFirst->GetUserData())->GetPos() == nCurrPos) - { - Select(pFirst); - MakeVisible(pFirst); - } + Select(pFirst); + MakeVisible(pFirst); } } } @@ -2995,10 +2999,10 @@ bool SwContentTree::Select( SvTreeListEntry* pEntry, bool bSelect ) } } SwNavigationPI* pNavi = GetParentWindow(); - pNavi->m_aContentToolBox->EnableItem(FN_ITEM_UP , bEnable); - pNavi->m_aContentToolBox->EnableItem(FN_ITEM_DOWN, bEnable); - pNavi->m_aContentToolBox->EnableItem(FN_ITEM_LEFT, bEnable); - pNavi->m_aContentToolBox->EnableItem(FN_ITEM_RIGHT,bEnable); + pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("up"), bEnable); + pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("down"), bEnable); + pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("promote"), bEnable); + pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("demote"), bEnable); return SvTreeListBox::Select(pEntry, bSelect); } @@ -3441,7 +3445,7 @@ void SwContentTree::DataChanged(const DataChangedEvent& rDCEvt) SwNavigationPI* SwContentTree::GetParentWindow() { - return static_cast<SwNavigationPI*>(Window::GetParent()); + return m_xDialog; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index e47dabbdde6b..90febb4d8bbc 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -144,21 +144,18 @@ void SwGlobalFrameListener_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& bValid = false; } -SwGlobalTree::SwGlobalTree(vcl::Window* pParent, const ResId& rResId) : - - SvTreeListBox(pParent, rResId), - - pActiveShell ( nullptr ), - pEmphasisEntry ( nullptr ), - pDDSource ( nullptr ), - pSwGlblDocContents ( nullptr ), - pDocContent ( nullptr ), - pDocInserter ( nullptr ), - - bIsInternalDrag ( false ), - bLastEntryEmphasis ( false ), - bIsImageListInitialized ( false ) - +SwGlobalTree::SwGlobalTree(vcl::Window* pParent, SwNavigationPI* pDialog) + : SvTreeListBox(pParent) + , xDialog(pDialog) + , pActiveShell(nullptr) + , pEmphasisEntry(nullptr) + , pDDSource(nullptr) + , pSwGlblDocContents(nullptr) + , pDocContent(nullptr) + , pDocInserter(nullptr) + , bIsInternalDrag(false) + , bLastEntryEmphasis(false) + , bIsImageListInitialized(false) { SetDragDropMode(DragDropMode::APP_COPY | DragDropMode::CTRL_MOVE | @@ -189,9 +186,15 @@ void SwGlobalTree::dispose() delete pDocInserter; pDocInserter = nullptr; aUpdateTimer.Stop(); + xDialog.clear(); SvTreeListBox::dispose(); } +Size SwGlobalTree::GetOptimalSize() const +{ + return LogicToPixel(Size(110, 112), MapUnit::MapAppFont); +} + sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) { sal_Int8 nRet = DND_ACTION_NONE; @@ -391,10 +394,11 @@ VclPtr<PopupMenu> SwGlobalTree::CreateContextMenu() void SwGlobalTree::TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox) { const sal_uInt16 nEnableFlags = GetEnableFlags(); - if(FN_GLOBAL_OPEN == nTbxId) + const OUString sCommand(pBox->GetItemCommand(nTbxId)); + if (sCommand == "insert") { ScopedVclPtrInstance<PopupMenu> pMenu; - for (sal_uInt16 i = CTX_INSERT_ANY_INDEX; i <= CTX_INSERT_TEXT; i++) + for (sal_uInt16 i = CTX_INSERT_ANY_INDEX; i <= CTX_INSERT_TEXT; ++i) { pMenu->InsertItem( i, aContextStrings[STR_INDEX - STR_GLOBAL_CONTEXT_FIRST - CTX_INSERT_ANY_INDEX + i] ); pMenu->SetHelpId(i, aHelpForMenu[i] ); @@ -409,7 +413,7 @@ void SwGlobalTree::TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox) pBox->EndSelection(); pBox->Invalidate(); } - else if(FN_GLOBAL_UPDATE == nTbxId) + else if (sCommand == "update") { ScopedVclPtrInstance<PopupMenu> pMenu; for (sal_uInt16 i = CTX_UPDATE_SEL; i <= CTX_UPDATE_ALL; i++) @@ -513,12 +517,12 @@ void SwGlobalTree::SelectHdl() SwNavigationPI* pNavi = GetParentWindow(); bool bReadonly = !pActiveShell || pActiveShell->GetView().GetDocShell()->IsReadOnly(); - pNavi->m_aGlobalToolBox->EnableItem(FN_GLOBAL_EDIT, nSelCount == 1 && !bReadonly); - pNavi->m_aGlobalToolBox->EnableItem(FN_GLOBAL_OPEN, nSelCount <= 1 && !bReadonly); - pNavi->m_aGlobalToolBox->EnableItem(FN_GLOBAL_UPDATE, GetEntryCount() > 0 && !bReadonly); - pNavi->m_aGlobalToolBox->EnableItem(FN_ITEM_UP, + pNavi->m_aGlobalToolBox->EnableItem(pNavi->m_aGlobalToolBox->GetItemId("edit"), nSelCount == 1 && !bReadonly); + pNavi->m_aGlobalToolBox->EnableItem(pNavi->m_aGlobalToolBox->GetItemId("insert"), nSelCount <= 1 && !bReadonly); + pNavi->m_aGlobalToolBox->EnableItem(pNavi->m_aGlobalToolBox->GetItemId("update"), GetEntryCount() > 0 && !bReadonly); + pNavi->m_aGlobalToolBox->EnableItem(pNavi->m_aGlobalToolBox->GetItemId("up"), nSelCount == 1 && nAbsPos && !bReadonly); - pNavi->m_aGlobalToolBox->EnableItem(FN_ITEM_DOWN, + pNavi->m_aGlobalToolBox->EnableItem(pNavi->m_aGlobalToolBox->GetItemId("down"), nSelCount == 1 && nAbsPos < GetEntryCount() - 1 && !bReadonly); } @@ -1045,11 +1049,11 @@ void SwGlobalTree::HideTree() SvTreeListBox::Hide(); } -void SwGlobalTree::ExecCommand(sal_uInt16 nCmd) +void SwGlobalTree::ExecCommand(const OUString &rCmd) { SvTreeListEntry* pEntry = FirstSelected(); OSL_ENSURE(pEntry, "It explodes in the next moment"); - if(FN_GLOBAL_EDIT == nCmd) + if (rCmd == "edit") { const SwGlblDocContent* pCont = static_cast<const SwGlblDocContent*>( pEntry->GetUserData()); @@ -1062,22 +1066,17 @@ void SwGlobalTree::ExecCommand(sal_uInt16 nCmd) bool bMove = false; sal_uLong nSource = GetModel()->GetAbsPos(pEntry); sal_uLong nDest = nSource; - switch(nCmd) + if (rCmd == "down") { - case FN_ITEM_DOWN: - { - sal_uLong nEntryCount = GetEntryCount(); - bMove = nEntryCount > nSource + 1; - nDest+= 2; - } - break; - case FN_ITEM_UP: - { - if(nSource) - bMove = 0 != nSource; - nDest--; - } - break; + sal_uLong nEntryCount = GetEntryCount(); + bMove = nEntryCount > nSource + 1; + nDest+= 2; + } + else if (rCmd == "up") + { + if(nSource) + bMove = 0 != nSource; + nDest--; } if( bMove && pActiveShell->MoveGlobalDocContent( *pSwGlblDocContents, nSource, nSource + 1, nDest ) && @@ -1209,7 +1208,7 @@ IMPL_LINK_NOARG( SwGlobalTree, DoubleClickHdl, SvTreeListBox*, bool) SwNavigationPI* SwGlobalTree::GetParentWindow() { - return static_cast<SwNavigationPI*>(Window::GetParent()); + return xDialog; } IMPL_STATIC_LINK_NOARG(SwGlobalTree, ShowFrameHdl, void*, void) diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index fa586e65585e..a6f293bc6008 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -21,7 +21,9 @@ #include <comphelper/string.hxx> #include <svl/urlbmk.hxx> #include <svl/stritem.hxx> +#include <vcl/builderfactory.hxx> #include <vcl/graphicfilter.hxx> +#include <vcl/layout.hxx> #include <svl/urihelper.hxx> #include <sot/formats.hxx> #include <sot/filelist.hxx> @@ -29,6 +31,7 @@ #include <sfx2/imgmgr.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/dockwin.hxx> +#include <sfx2/navigat.hxx> #include <vcl/toolbox.hxx> #include <vcl/settings.hxx> #include <swtypes.hxx> @@ -212,6 +215,7 @@ void SwNavigationPI::UsePage() IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox, void ) { const sal_uInt16 nCurrItemId = pBox->GetCurItemId(); + const OUString sCommand = pBox->GetItemCommand(nCurrItemId); SwView *pView = GetCreateView(); if (!pView) return; @@ -223,125 +227,118 @@ IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox, void ) bool bOutlineWithChildren = ( KEY_MOD1 != pBox->GetModifier()); int nFuncId = 0; bool bFocusToDoc = false; - switch (nCurrItemId) + if (sCommand == "back") { - case FN_UP: - case FN_DOWN: - { - // #i75416# move the execution of the search to an asynchronously called static link - bool* pbNext = new bool( FN_DOWN == nCurrItemId ); - Application::PostUserEvent( LINK(pView, SwView, MoveNavigationHdl), pbNext, true ); - } - break; - case FN_SHOW_ROOT: - { - m_aContentTree->ToggleToRoot(); - } - break; - case FN_SHOW_CONTENT_BOX: - case FN_SELECT_CONTENT: - if(m_pContextWin!=nullptr && m_pContextWin->GetFloatingWindow()!=nullptr) - { - if(IsZoomedIn() ) - { - ZoomOut(); - } - else - { - ZoomIn(); - } - } - return; - // Functions that will trigger a direct action. - - case FN_SELECT_FOOTER: + // #i75416# move the execution of the search to an asynchronously called static link + bool* pbNext = new bool(false); + Application::PostUserEvent(LINK(pView, SwView, MoveNavigationHdl), pbNext, true); + } + if (sCommand == "forward") + { + // #i75416# move the execution of the search to an asynchronously called static link + bool* pbNext = new bool(true); + Application::PostUserEvent(LINK(pView, SwView, MoveNavigationHdl), pbNext, true); + } + else if (sCommand == "root") + { + m_aContentTree->ToggleToRoot(); + } + else if (sCommand == "listbox") + { + if (m_pContextWin && m_pContextWin->GetFloatingWindow()) { - rSh.MoveCursor(); - const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false); - if (eType & FrameTypeFlags::FOOTER) + if (IsZoomedIn()) { - if (rSh.EndPg()) - nFuncId = FN_END_OF_PAGE; + ZoomOut(); } - else if (rSh.GotoFooterText()) - nFuncId = FN_TO_FOOTER; - bFocusToDoc = true; - } - break; - case FN_SELECT_HEADER: - { - rSh.MoveCursor(); - const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false); - if (eType & FrameTypeFlags::HEADER) + else { - if (rSh.SttPg()) - nFuncId = FN_START_OF_PAGE; + ZoomIn(); } - else if (rSh.GotoHeaderText()) - nFuncId = FN_TO_HEADER; - bFocusToDoc = true; } - break; - case FN_SELECT_FOOTNOTE: + return; + } + // Functions that will trigger a direct action. + else if (sCommand == "footer") + { + rSh.MoveCursor(); + const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false); + if (eType & FrameTypeFlags::FOOTER) { - rSh.MoveCursor(); - const FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,false); - // Jump from the footnote to the anchor. - if (eFrameType & FrameTypeFlags::FOOTNOTE) - { - if (rSh.GotoFootnoteAnchor()) - nFuncId = FN_FOOTNOTE_TO_ANCHOR; - } - // Otherwise, jump to the first footnote text; - // go to the next footnote if this is not possible; - // if this is also not possible got to the footnote before. - else - { - if (rSh.GotoFootnoteText()) - nFuncId = FN_FOOTNOTE_TO_ANCHOR; - else if (rSh.GotoNextFootnoteAnchor()) - nFuncId = FN_NEXT_FOOTNOTE; - else if (rSh.GotoPrevFootnoteAnchor()) - nFuncId = FN_PREV_FOOTNOTE; - } - bFocusToDoc = true; + if (rSh.EndPg()) + nFuncId = FN_END_OF_PAGE; } - break; - - case FN_SELECT_SET_AUTO_BOOKMARK: - MakeMark(); - break; - case FN_ITEM_DOWN: - case FN_ITEM_UP: - case FN_ITEM_LEFT: - case FN_ITEM_RIGHT: - case FN_GLOBAL_EDIT: + else if (rSh.GotoFooterText()) + nFuncId = FN_TO_FOOTER; + bFocusToDoc = true; + } + else if (sCommand == "header") + { + rSh.MoveCursor(); + const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false); + if (eType & FrameTypeFlags::HEADER) { - if(IsGlobalMode()) - m_aGlobalTree->ExecCommand(nCurrItemId); - else - m_aContentTree->ExecCommand(nCurrItemId, bOutlineWithChildren); + if (rSh.SttPg()) + nFuncId = FN_START_OF_PAGE; } - break; - case FN_GLOBAL_SWITCH: + else if (rSh.GotoHeaderText()) + nFuncId = FN_TO_HEADER; + bFocusToDoc = true; + } + else if (sCommand == "anchor") + { + rSh.MoveCursor(); + const FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,false); + // Jump from the footnote to the anchor. + if (eFrameType & FrameTypeFlags::FOOTNOTE) { - ToggleTree(); - m_pConfig->SetGlobalActive(IsGlobalMode()); + if (rSh.GotoFootnoteAnchor()) + nFuncId = FN_FOOTNOTE_TO_ANCHOR; } - break; - case FN_GLOBAL_SAVE_CONTENT: + // Otherwise, jump to the first footnote text; + // go to the next footnote if this is not possible; + // if this is also not possible got to the footnote before. + else { - bool bSave = rSh.IsGlblDocSaveLinks(); - rSh.SetGlblDocSaveLinks( !bSave ); - pBox->CheckItem(FN_GLOBAL_SAVE_CONTENT, !bSave ); + if (rSh.GotoFootnoteText()) + nFuncId = FN_FOOTNOTE_TO_ANCHOR; + else if (rSh.GotoNextFootnoteAnchor()) + nFuncId = FN_NEXT_FOOTNOTE; + else if (rSh.GotoPrevFootnoteAnchor()) + nFuncId = FN_PREV_FOOTNOTE; } - break; + bFocusToDoc = true; } - if (nFuncId) + else if (sCommand == "reminder") { - lcl_UnSelectFrame(&rSh); + MakeMark(); } - if(bFocusToDoc) + else if (sCommand == "down" || + sCommand == "up" || + sCommand == "promote" || + sCommand == "demote" || + sCommand == "edit") + { + if (IsGlobalMode()) + m_aGlobalTree->ExecCommand(sCommand); + else + m_aContentTree->ExecCommand(sCommand, bOutlineWithChildren); + } + else if (sCommand == "toggle") + { + ToggleTree(); + m_pConfig->SetGlobalActive(IsGlobalMode()); + } + else if (sCommand == "save") + { + bool bSave = rSh.IsGlblDocSaveLinks(); + rSh.SetGlblDocSaveLinks( !bSave ); + pBox->CheckItem(nCurrItemId, !bSave ); + } + + if (nFuncId) + lcl_UnSelectFrame(&rSh); + if (bFocusToDoc) pView->GetEditWin().GrabFocus(); } @@ -350,90 +347,75 @@ IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox, void ) IMPL_LINK( SwNavigationPI, ToolBoxClickHdl, ToolBox *, pBox, void ) { const sal_uInt16 nCurrItemId = pBox->GetCurItemId(); - switch (nCurrItemId) - { - case FN_GLOBAL_UPDATE: - case FN_GLOBAL_OPEN: - { - m_aGlobalTree->TbxMenuHdl(nCurrItemId, pBox); - } - break; - } + const OUString sCommand = pBox->GetItemCommand(nCurrItemId); + if (sCommand == "update" || sCommand == "insert") + m_aGlobalTree->TbxMenuHdl(nCurrItemId, pBox); } IMPL_LINK( SwNavigationPI, ToolBoxDropdownClickHdl, ToolBox*, pBox, void ) { const sal_uInt16 nCurrItemId = pBox->GetCurItemId(); - switch (nCurrItemId) + const OUString sCommand = pBox->GetItemCommand(nCurrItemId); + if (sCommand == "navigation") + CreateNavigationTool(pBox->GetItemRect(nCurrItemId), true, this); + else if (sCommand == "dragmode") { - case FN_CREATE_NAVIGATION: + static const char* aHIDs[] = { - CreateNavigationTool(pBox->GetItemRect(FN_CREATE_NAVIGATION), true, this); - } - break; - - case FN_DROP_REGION: + HID_NAVI_DRAG_HYP, + HID_NAVI_DRAG_LINK, + HID_NAVI_DRAG_COPY, + }; + ScopedVclPtrInstance<PopupMenu> pMenu; + for (sal_uInt16 i = 0; i <= static_cast<sal_uInt16>(RegionMode::EMBEDDED); ++i) { - static const char* aHIDs[] = - { - HID_NAVI_DRAG_HYP, - HID_NAVI_DRAG_LINK, - HID_NAVI_DRAG_COPY, - }; - ScopedVclPtrInstance<PopupMenu> pMenu; - for (sal_uInt16 i = 0; i <= static_cast<sal_uInt16>(RegionMode::EMBEDDED); ++i) - { - pMenu->InsertItem(i + 1, m_aContextArr[i], MenuItemBits::RADIOCHECK); - pMenu->SetHelpId(i + 1, aHIDs[i]); - } - pMenu->CheckItem( static_cast<int>(m_nRegionMode) + 1 ); - pMenu->SetSelectHdl(LINK(this, SwNavigationPI, MenuSelectHdl)); - pBox->SetItemDown( nCurrItemId, true ); - pMenu->Execute( pBox, - pBox->GetItemRect(FN_DROP_REGION), - PopupMenuFlags::ExecuteDown ); - pBox->SetItemDown( nCurrItemId, false ); - pBox->EndSelection(); - pMenu.disposeAndClear(); - pBox->Invalidate(); + pMenu->InsertItem(i + 1, m_aContextArr[i], MenuItemBits::RADIOCHECK); + pMenu->SetHelpId(i + 1, aHIDs[i]); } - break; - case FN_OUTLINE_LEVEL: + pMenu->CheckItem( static_cast<int>(m_nRegionMode) + 1 ); + pMenu->SetSelectHdl(LINK(this, SwNavigationPI, MenuSelectHdl)); + pBox->SetItemDown(nCurrItemId, true); + pMenu->Execute(pBox, pBox->GetItemRect(nCurrItemId), PopupMenuFlags::ExecuteDown); + pBox->SetItemDown(nCurrItemId, false); + pBox->EndSelection(); + pMenu.disposeAndClear(); + pBox->Invalidate(); + } + else if (sCommand == "headings") + { + ScopedVclPtrInstance<PopupMenu> pMenu; + for (sal_uInt16 i = 101; i <= 100 + MAXLEVEL; ++i) { - ScopedVclPtrInstance<PopupMenu> pMenu; - for (sal_uInt16 i = 101; i <= 100 + MAXLEVEL; ++i) - { - pMenu->InsertItem(i, OUString::number(i - 100), MenuItemBits::RADIOCHECK); - pMenu->SetHelpId(i, HID_NAVI_OUTLINES); - } - pMenu->CheckItem( m_aContentTree->GetOutlineLevel() + 100 ); - pMenu->SetSelectHdl(LINK(this, SwNavigationPI, MenuSelectHdl)); - pBox->SetItemDown( nCurrItemId, true ); - pMenu->Execute( pBox, - pBox->GetItemRect(FN_OUTLINE_LEVEL), - PopupMenuFlags::ExecuteDown ); - pBox->SetItemDown( nCurrItemId, false ); - pMenu.disposeAndClear(); - pBox->EndSelection(); - pBox->Invalidate(); + pMenu->InsertItem(i, OUString::number(i - 100), MenuItemBits::RADIOCHECK); + pMenu->SetHelpId(i, HID_NAVI_OUTLINES); } - break; + pMenu->CheckItem( m_aContentTree->GetOutlineLevel() + 100 ); + pMenu->SetSelectHdl(LINK(this, SwNavigationPI, MenuSelectHdl)); + pBox->SetItemDown( nCurrItemId, true ); + pMenu->Execute(pBox, pBox->GetItemRect(nCurrItemId), PopupMenuFlags::ExecuteDown); + pBox->SetItemDown( nCurrItemId, false ); + pMenu.disposeAndClear(); + pBox->EndSelection(); + pBox->Invalidate(); } } -SwNavHelpToolBox::SwNavHelpToolBox(SwNavigationPI* pParent, const ResId &rResId) - : ToolBox(pParent, rResId) -{} +SwNavHelpToolBox::SwNavHelpToolBox(Window* pParent) + : ToolBox(pParent) +{ +} + +VCL_BUILDER_FACTORY(SwNavHelpToolBox) void SwNavHelpToolBox::MouseButtonDown(const MouseEvent &rEvt) { - if(rEvt.GetButtons() == MOUSE_LEFT && - FN_CREATE_NAVIGATION == GetItemId(rEvt.GetPosPixel())) + sal_uInt16 nItemId = GetItemId(rEvt.GetPosPixel()); + if (rEvt.GetButtons() == MOUSE_LEFT && GetItemCommand(nItemId) == "navigation") { - static_cast<SwNavigationPI*>(GetParent())->CreateNavigationTool(GetItemRect(FN_CREATE_NAVIGATION), false, this); + m_xDialog->CreateNavigationTool(GetItemRect(nItemId), false, this); + return; } - else - ToolBox::MouseButtonDown(rEvt); + ToolBox::MouseButtonDown(rEvt); } void SwNavigationPI::CreateNavigationTool(const Rectangle& rRect, bool bSetFocus, vcl::Window *pParent) @@ -454,16 +436,28 @@ void SwNavigationPI::CreateNavigationTool(const Rectangle& rRect, bool bSetFocus } } -void SwNavHelpToolBox::RequestHelp( const HelpEvent& rHEvt ) +void SwNavHelpToolBox::RequestHelp(const HelpEvent& rHEvt) { const sal_uInt16 nItemId = GetItemId(ScreenToOutputPixel(rHEvt.GetMousePosPixel())); - if( FN_UP == nItemId || FN_DOWN == nItemId ) - { - SetItemText(nItemId, SwScrollNaviPopup::GetQuickHelpText((FN_DOWN == nItemId))); - } + const OUString sCommand(GetItemCommand(nItemId)); + if (sCommand == "back") + SetQuickHelpText(nItemId, SwScrollNaviPopup::GetQuickHelpText(false)); + else if (sCommand == "forward") + SetQuickHelpText(nItemId, SwScrollNaviPopup::GetQuickHelpText(true)); ToolBox::RequestHelp(rHEvt); } +void SwNavHelpToolBox::dispose() +{ + m_xDialog.clear(); + ToolBox::dispose(); +} + +SwNavHelpToolBox::~SwNavHelpToolBox() +{ + disposeOnce(); +} + // Action-Handler Edit: // Switches to the page if the structure view is not turned on. @@ -527,260 +521,167 @@ void SwNavigationPI::MakeMark() void SwNavigationPI::ZoomOut() { - if (IsZoomedIn()) + if (!IsZoomedIn()) + return; + SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(GetParent()); + if (!pNav) + return; + m_bIsZoomedIn = false; + FillBox(); + if (IsGlobalMode()) { - FloatingWindow* pFloat = m_pContextWin!=nullptr ? m_pContextWin->GetFloatingWindow() : nullptr; - m_bIsZoomedIn = false; - Size aSz(GetOutputSizePixel()); - aSz.Height() = m_nZoomOut; - Size aMinOutSizePixel = static_cast<SfxDockingWindow*>(GetParent())->GetMinOutputSizePixel(); - static_cast<SfxDockingWindow*>(GetParent())->SetMinOutputSizePixel(Size( - aMinOutSizePixel.Width(),m_nZoomOutInit)); - if (pFloat != nullptr) - pFloat->SetOutputSizePixel(aSz); - FillBox(); - if(IsGlobalMode()) - { - m_aGlobalTree->ShowTree(); - } - else - { - m_aContentTree->ShowTree(); - m_aDocListBox->Show(); - } - SvTreeListEntry* pFirst = m_aContentTree->FirstSelected(); - if(pFirst) - m_aContentTree->Select(pFirst); // Enable toolbox - m_pConfig->SetSmall( false ); - m_aContentToolBox->CheckItem(FN_SHOW_CONTENT_BOX); + m_aGlobalBox->Show(); + m_aGlobalTree->ShowTree(); } -} - -void SwNavigationPI::ZoomIn() -{ - if (m_pContextWin != nullptr) + else { - FloatingWindow* pFloat = m_pContextWin->GetFloatingWindow(); - if (pFloat && - (!IsZoomedIn() || ( m_pContextWin->GetFloatingWindow()->IsRollUp()))) - { - m_aContentTree->HideTree(); - m_aDocListBox->Hide(); - m_aGlobalTree->HideTree(); - m_bIsZoomedIn = true; - Size aSz(GetOutputSizePixel()); - if( aSz.Height() > m_nZoomIn ) - m_nZoomOut = ( short ) aSz.Height(); - - aSz.Height() = m_nZoomIn; - Size aMinOutSizePixel = static_cast<SfxDockingWindow*>(GetParent())->GetMinOutputSizePixel(); - static_cast<SfxDockingWindow*>(GetParent())->SetMinOutputSizePixel(Size( - aMinOutSizePixel.Width(), aSz.Height())); - pFloat->SetOutputSizePixel(aSz); - SvTreeListEntry* pFirst = m_aContentTree->FirstSelected(); - if(pFirst) - m_aContentTree->Select(pFirst); // Enable toolbox - m_pConfig->SetSmall( true ); - m_aContentToolBox->CheckItem(FN_SHOW_CONTENT_BOX, false); - } + m_aContentBox->Show(); + m_aContentTree->ShowTree(); + m_aDocListBox->Show(); } + + Size aOptimalSize(GetOptimalSize()); + Size aNewSize(pNav->GetOutputSizePixel()); + aNewSize.Height() = m_aExpandedSize.Height(); + pNav->SetMinOutputSizePixel(aOptimalSize); + pNav->SetOutputSizePixel(aNewSize); + + SvTreeListEntry* pFirst = m_aContentTree->FirstSelected(); + if (pFirst) + m_aContentTree->Select(pFirst); // Enable toolbox + m_pConfig->SetSmall(false); + m_aContentToolBox->CheckItem(m_aContentToolBox->GetItemId("listbox")); } -void SwNavigationPI::Resize() +void SwNavigationPI::ZoomIn() { - vcl::Window* pParent = GetParent(); - if( !IsZoomedIn() ) - { - Size aNewSize (pParent->GetOutputSizePixel()); - - SfxDockingWindow* pDockingParent = dynamic_cast<SfxDockingWindow*>(pParent); - if (pDockingParent != nullptr) - { - FloatingWindow* pFloat = pDockingParent->GetFloatingWindow(); - //change the minimum width depending on the dock status - Size aMinOutSizePixel = pDockingParent->GetMinOutputSizePixel(); - if( pFloat) - { - aNewSize = pFloat->GetOutputSizePixel(); - aMinOutSizePixel.Width() = m_nWishWidth; - aMinOutSizePixel.Height() = IsZoomedIn() ? m_nZoomIn : m_nZoomOutInit; - } - else - { - aMinOutSizePixel.Width() = 0; - aMinOutSizePixel.Height() = 0; - } - pDockingParent->SetMinOutputSizePixel(aMinOutSizePixel); - } + if (IsZoomedIn()) + return; + SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(GetParent()); + if (!pNav) + return; - const Point aPos = m_aContentTree->GetPosPixel(); - Point aLBPos = m_aDocListBox->GetPosPixel(); - long nDist = aPos.X(); - aNewSize.Height() -= (aPos.Y() + aPos.X() + m_nDocLBIniHeight + nDist); - aNewSize.Width() -= 2 * nDist; - aLBPos.Y() = aPos.Y() + aNewSize.Height() + nDist; - m_aDocListBox->Show(!m_aGlobalTree->IsVisible() && aLBPos.Y() > aPos.Y() ); - - Size aDocLBSz = m_aDocListBox->GetSizePixel(); - aDocLBSz.Width() = aNewSize.Width(); - if(aNewSize.Height() < 0) - aDocLBSz.Height() = 0; - else - aDocLBSz.Height() = m_nDocLBIniHeight; - m_aContentTree->SetSizePixel(aNewSize); - // GlobalTree starts on to the top and goes all the way down. - aNewSize.Height() += (nDist + m_nDocLBIniHeight + aPos.Y() - m_aGlobalTree->GetPosPixel().Y()); - m_aGlobalTree->SetSizePixel(aNewSize); - m_aDocListBox->setPosSizePixel( aLBPos.X(), aLBPos.Y(), - aDocLBSz.Width(), aDocLBSz.Height(), - PosSizeFlags::X|PosSizeFlags::Y|PosSizeFlags::Width); - } + m_aExpandedSize = GetSizePixel(); + + m_aContentBox->Hide(); + m_aContentTree->HideTree(); + m_aGlobalBox->Hide(); + m_aGlobalTree->HideTree(); + m_aDocListBox->Hide(); + m_bIsZoomedIn = true; + + Size aOptimalSize(GetOptimalSize()); + Size aNewSize(pNav->GetOutputSizePixel()); + aNewSize.Height() = aOptimalSize.Height(); + pNav->SetMinOutputSizePixel(aOptimalSize); + pNav->SetOutputSizePixel(aNewSize); + + SvTreeListEntry* pFirst = m_aContentTree->FirstSelected(); + if (pFirst) + m_aContentTree->Select(pFirst); // Enable toolbox + m_pConfig->SetSmall(true); + m_aContentToolBox->CheckItem(m_aContentToolBox->GetItemId("listbox"), false); } -SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, - SfxChildWindowContext* pCw, - vcl::Window* pParent) : - - Window( pParent, SW_RES(DLG_NAVIGATION_PI)), - SfxControllerItem( SID_DOCFULLNAME, *_pBindings ), - - m_aContentToolBox(VclPtr<SwNavHelpToolBox>::Create(this, SW_RES(TB_CONTENT))), - m_aGlobalToolBox(VclPtr<ToolBox>::Create(this, SW_RES(TB_GLOBAL))), - m_aContentImageList(SW_RES(IL_CONTENT)), - m_aContentTree(VclPtr<SwContentTree>::Create(this, SW_RES(TL_CONTENT))), - m_aGlobalTree(VclPtr<SwGlobalTree>::Create(this, SW_RES(TL_GLOBAL))), - m_aDocListBox(VclPtr<ListBox>::Create(this, SW_RES(LB_DOCS))), - - m_pxObjectShell(nullptr), - m_pContentView(nullptr), - m_pContentWrtShell(nullptr), - m_pActContView(nullptr), - m_pCreateView(nullptr), - m_pPopupWindow(nullptr), - m_pFloatingWindow(nullptr), - - m_pContextWin(pCw), - - m_pConfig(SW_MOD()->GetNavigationConfig()), - m_rBindings(*_pBindings), - - m_nWishWidth(0), - m_nAutoMarkIdx(1), - m_nRegionMode(RegionMode::NONE), - - m_bIsZoomedIn(false), - m_bPageCtrlsVisible(false), - m_bGlobalMode(false) +SwNavigationPI::SwNavigationPI(SfxBindings* _pBindings, + SfxChildWindowContext* pCw, + vcl::Window* pParent) + : PanelLayout(pParent, "NavigatorPanel", "modules/swriter/ui/navigatorpanel.ui", nullptr) + , SfxControllerItem(SID_DOCFULLNAME, *_pBindings) + , m_pxObjectShell(nullptr) + , m_pContentView(nullptr) + , m_pContentWrtShell(nullptr) + , m_pActContView(nullptr) + , m_pCreateView(nullptr) + , m_pPopupWindow(nullptr) + , m_pFloatingWindow(nullptr) + , m_pContextWin(pCw) + , m_pConfig(SW_MOD()->GetNavigationConfig()) + , m_rBindings(*_pBindings) + , m_nAutoMarkIdx(1) + , m_nRegionMode(RegionMode::NONE) + , m_bIsZoomedIn(false) + , m_bPageCtrlsVisible(false) + , m_bGlobalMode(false) { + get(m_aContentToolBox, "content"); + m_aContentToolBox->SetLineCount(2); + m_aContentToolBox->InsertBreak(8); + m_aContentToolBox->SetDialog(this); + get(m_aGlobalToolBox, "global"); + get(m_aDocListBox, "documents"); + + get(m_aContentBox, "contentbox"); + m_aContentTree = VclPtr<SwContentTree>::Create(m_aContentBox, this); + m_aContentTree->set_expand(true); + get(m_aGlobalBox, "globalbox"); + m_aGlobalTree = VclPtr<SwGlobalTree>::Create(m_aGlobalBox, this); + m_aGlobalTree->set_expand(true); + GetCreateView(); - InitImageList(); - m_aContentToolBox->SetHelpId(HID_NAVIGATOR_TOOLBOX ); + m_aContentToolBox->SetHelpId(HID_NAVIGATOR_TOOLBOX); m_aGlobalToolBox->SetHelpId(HID_NAVIGATOR_GLOBAL_TOOLBOX); - m_aDocListBox->SetHelpId(HID_NAVIGATOR_LISTBOX ); + m_aDocListBox->SetHelpId(HID_NAVIGATOR_LISTBOX); m_aDocListBox->SetDropDownLineCount(9); - m_nDocLBIniHeight = m_aDocListBox->GetSizePixel().Height(); - m_nZoomOutInit = m_nZoomOut = Resource::ReadShortRes(); - // Insert the numeric field in the toolbox. - VclPtr<NumEditAction> pEdit = VclPtr<NumEditAction>::Create( + m_xEdit = VclPtr<NumEditAction>::Create( m_aContentToolBox.get(), WB_BORDER|WB_TABSTOP|WB_LEFT|WB_REPEAT|WB_SPIN); - pEdit->SetActionHdl(LINK(this, SwNavigationPI, EditAction)); - pEdit->SetGetFocusHdl(LINK(this, SwNavigationPI, EditGetFocus)); - pEdit->SetAccessibleName(pEdit->GetQuickHelpText()); - pEdit->SetUpHdl(LINK(this, SwNavigationPI, PageEditModifyHdl)); - pEdit->SetDownHdl(LINK(this, SwNavigationPI, PageEditModifyHdl)); + m_xEdit->SetMin(1); + m_xEdit->SetFirst(1); + m_xEdit->SetActionHdl(LINK(this, SwNavigationPI, EditAction)); + m_xEdit->SetGetFocusHdl(LINK(this, SwNavigationPI, EditGetFocus)); + m_xEdit->SetAccessibleName(m_xEdit->GetQuickHelpText()); + m_xEdit->SetUpHdl(LINK(this, SwNavigationPI, PageEditModifyHdl)); + m_xEdit->SetDownHdl(LINK(this, SwNavigationPI, PageEditModifyHdl)); m_bPageCtrlsVisible = true; // Double separators are not allowed, so you have to // determine the suitable size differently. - Rectangle aFirstRect = m_aContentToolBox->GetItemRect(FN_SELECT_FOOTNOTE); - Rectangle aSecondRect = m_aContentToolBox->GetItemRect(FN_SELECT_HEADER); + Rectangle aFirstRect = m_aContentToolBox->GetItemRect(m_aContentToolBox->GetItemId("anchor")); + Rectangle aSecondRect = m_aContentToolBox->GetItemRect(m_aContentToolBox->GetItemId("header")); Size aItemWinSize( aFirstRect.Left() - aSecondRect.Left(), aFirstRect.Bottom() - aFirstRect.Top() ); - Size aOptimalSize(pEdit->get_preferred_size()); + Size aOptimalSize(m_xEdit->get_preferred_size()); aItemWinSize.Width() = std::max(aItemWinSize.Width(), aOptimalSize.Width()); - pEdit->SetSizePixel(aItemWinSize); + m_xEdit->SetSizePixel(aItemWinSize); m_aContentToolBox->InsertSeparator(4); - m_aContentToolBox->InsertWindow( FN_PAGENUMBER, pEdit, ToolBoxItemBits::NONE, 4); + m_aContentToolBox->InsertWindow( FN_PAGENUMBER, m_xEdit, ToolBoxItemBits::NONE, 4); m_aContentToolBox->InsertSeparator(4); - m_aContentToolBox->SetHelpId(FN_PAGENUMBER, HID_NAVI_TBX16); - m_aContentToolBox->ShowItem( FN_PAGENUMBER ); - if(!IsGlobalDoc()){ - m_aContentToolBox->HideItem( FN_GLOBAL_SWITCH ); + m_aContentToolBox->SetHelpId(FN_PAGENUMBER, "modules/swriter/ui/navigatorpanel/numericfield"); + m_aContentToolBox->ShowItem(FN_PAGENUMBER); + if (!IsGlobalDoc()) + { + m_aContentToolBox->HideItem(m_aContentToolBox->GetItemId("toggle")); } - for( sal_uInt16 i = 0; i <= static_cast<sal_uInt16>(RegionMode::EMBEDDED); i++ ) + for (sal_uInt16 i = 0; i <= static_cast<sal_uInt16>(RegionMode::EMBEDDED); ++i) { m_aContextArr[i] = SW_RESSTR(STR_HYPERLINK + i); m_aStatusArr[i] = SW_RESSTR(STR_STATUS_FIRST + i); } - m_aStatusArr[3] = SW_RESSTR(STR_ACTIVE_VIEW); - FreeResource(); - - const Size& rOutSize = GetOutputSizePixel(); - - m_nZoomIn = (short)rOutSize.Height(); - - // Make sure the toolbox has a size that fits all its contents - Size aContentToolboxSize( m_aContentToolBox->CalcWindowSizePixel() ); - m_aContentToolBox->SetOutputSizePixel( aContentToolboxSize ); - // position listbox below toolbar and add some space - long nListboxYPos = m_aContentToolBox->GetPosPixel().Y() + aContentToolboxSize.Height() + 4; - - // The left and right margins around the toolboxes should be equal. - m_nWishWidth = aContentToolboxSize.Width(); - m_nWishWidth += 2 * m_aContentToolBox->GetPosPixel().X(); - - DockingWindow* pDockingParent = dynamic_cast<DockingWindow*>(pParent); - if (pDockingParent != nullptr) - { - FloatingWindow* pFloat = pDockingParent->GetFloatingWindow(); - Size aMinSize(pFloat ? m_nWishWidth : 0, pFloat ? m_nZoomOutInit : 0); - pDockingParent->SetMinOutputSizePixel(aMinSize); - SetOutputSizePixel( Size( m_nWishWidth, m_nZoomOutInit*2)); - - SfxDockingWindow* pSfxDockingParent = dynamic_cast<SfxDockingWindow*>(pParent); - if (pSfxDockingParent != nullptr) - { - Size aTmpParentSize(pSfxDockingParent->GetSizePixel()); - if (aTmpParentSize.Width() < aMinSize.Width() - || aTmpParentSize.Height() < aMinSize.Height()) - { - if (pSfxDockingParent->GetFloatingWindow() - && ! pSfxDockingParent->GetFloatingWindow()->IsRollUp()) - { - pSfxDockingParent->SetOutputSizePixel(aMinSize); - } - } - } - } + m_aStatusArr[3] = SW_RESSTR(STR_ACTIVE_VIEW); - m_aContentTree->setPosSizePixel( 0, nListboxYPos, 0, 0, PosSizeFlags::Y ); - m_aContentTree->SetStyle( m_aContentTree->GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT| - WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE ); + m_aContentTree->SetStyle(m_aContentTree->GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT| + WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE ); m_aContentTree->SetSpaceBetweenEntries(3); - m_aContentTree->SetSelectionMode( SelectionMode::Single ); - m_aContentTree->SetDragDropMode( DragDropMode::CTRL_MOVE | - DragDropMode::CTRL_COPY | - DragDropMode::ENABLE_TOP ); + m_aContentTree->SetSelectionMode(SelectionMode::Single); + m_aContentTree->SetDragDropMode(DragDropMode::CTRL_MOVE | + DragDropMode::CTRL_COPY | + DragDropMode::ENABLE_TOP); m_aContentTree->EnableAsyncDrag(true); m_aContentTree->ShowTree(); - m_aContentToolBox->CheckItem(FN_SHOW_CONTENT_BOX); + m_aContentToolBox->CheckItem(m_aContentToolBox->GetItemId("listbox")); // TreeListBox for global document - m_aGlobalTree->setPosSizePixel( 0, nListboxYPos, 0, 0, PosSizeFlags::Y ); m_aGlobalTree->SetSelectionMode( SelectionMode::Multiple ); - m_aGlobalTree->SetStyle( m_aGlobalTree->GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT| - WB_CLIPCHILDREN|WB_HSCROLL ); - Size aGlblSize(m_aGlobalToolBox->CalcWindowSizePixel()); - m_aGlobalToolBox->SetSizePixel(aGlblSize); + m_aGlobalTree->SetStyle(m_aGlobalTree->GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT| + WB_CLIPCHILDREN|WB_HSCROLL); // Handler - Link<ToolBox *, void> aLk = LINK(this, SwNavigationPI, ToolBoxSelectHdl); m_aContentToolBox->SetSelectHdl( aLk ); m_aGlobalToolBox->SetSelectHdl( aLk ); @@ -790,7 +691,7 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, m_aContentToolBox->SetDropdownClickHdl( LINK(this, SwNavigationPI, ToolBoxDropdownClickHdl) ); m_aGlobalToolBox->SetClickHdl( LINK(this, SwNavigationPI, ToolBoxClickHdl) ); m_aGlobalToolBox->SetDropdownClickHdl( LINK(this, SwNavigationPI, ToolBoxDropdownClickHdl) ); - m_aGlobalToolBox->CheckItem(FN_GLOBAL_SWITCH); + m_aGlobalToolBox->CheckItem(m_aGlobalToolBox->GetItemId("toggle")); vcl::Font aFont(GetFont()); aFont.SetWeight(WEIGHT_NORMAL); @@ -807,16 +708,19 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, pImgMan->RegisterToolBox(m_aContentToolBox.get(), SfxToolboxFlags::CHANGEOUTSTYLE); pImgMan->RegisterToolBox(m_aGlobalToolBox.get(), SfxToolboxFlags::CHANGEOUTSTYLE); - m_aContentToolBox->SetItemBits( FN_CREATE_NAVIGATION, m_aContentToolBox->GetItemBits( FN_CREATE_NAVIGATION ) | ToolBoxItemBits::DROPDOWNONLY ); - m_aContentToolBox->SetItemBits( FN_DROP_REGION, m_aContentToolBox->GetItemBits( FN_DROP_REGION ) | ToolBoxItemBits::DROPDOWNONLY ); - m_aContentToolBox->SetItemBits( FN_OUTLINE_LEVEL, m_aContentToolBox->GetItemBits( FN_OUTLINE_LEVEL ) | ToolBoxItemBits::DROPDOWNONLY ); + sal_uInt16 nNavId = m_aContentToolBox->GetItemId("navigation"); + m_aContentToolBox->SetItemBits(nNavId, m_aContentToolBox->GetItemBits(nNavId) | ToolBoxItemBits::DROPDOWNONLY ); + sal_uInt16 nDropId = m_aContentToolBox->GetItemId("dragmode"); + m_aContentToolBox->SetItemBits(nDropId, m_aContentToolBox->GetItemBits(nDropId) | ToolBoxItemBits::DROPDOWNONLY ); + sal_uInt16 nOutlineId = m_aContentToolBox->GetItemId("headings"); + m_aContentToolBox->SetItemBits(nOutlineId, m_aContentToolBox->GetItemBits(nOutlineId) | ToolBoxItemBits::DROPDOWNONLY ); if(IsGlobalDoc()) { SwView *pActView = GetCreateView(); - m_aGlobalToolBox->CheckItem(FN_GLOBAL_SAVE_CONTENT, + m_aGlobalToolBox->CheckItem(m_aGlobalToolBox->GetItemId("save"), pActView->GetWrtShellPtr()->IsGlblDocSaveLinks()); - if(m_pConfig->IsGlobalActive()) + if (m_pConfig->IsGlobalActive()) ToggleTree(); m_aGlobalTree->GrabFocus(); } @@ -836,8 +740,10 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, // displayed in the sidebar. While the navigator could change // its size, the sidebar can not, and the navigator would just // waste space. Therefore hide this button. - m_aContentToolBox->RemoveItem(m_aContentToolBox->GetItemPos(FN_SHOW_CONTENT_BOX)); + m_aContentToolBox->RemoveItem(m_aContentToolBox->GetItemPos(m_aContentToolBox->GetItemId("listbox"))); } + + m_aExpandedSize = GetOptimalSize(); } SwNavigationPI::~SwNavigationPI() @@ -847,11 +753,11 @@ SwNavigationPI::~SwNavigationPI() void SwNavigationPI::dispose() { - if(IsGlobalDoc() && !IsGlobalMode()) + if (IsGlobalDoc() && !IsGlobalMode()) { SwView *pView = GetCreateView(); SwWrtShell &rSh = pView->GetWrtShell(); - if( !rSh.IsAllProtect() ) + if (!rSh.IsAllProtect()) pView->GetDocShell()->SetReadOnlyUI(false); } @@ -862,29 +768,32 @@ void SwNavigationPI::dispose() pImgMan->ReleaseToolBox(m_aGlobalToolBox.get()); m_aContentToolBox->GetItemWindow(FN_PAGENUMBER)->disposeOnce(); m_aContentToolBox->Clear(); - if(m_pxObjectShell) + if (m_pxObjectShell) { - if(m_pxObjectShell->Is()) + if (m_pxObjectShell->Is()) (*m_pxObjectShell)->DoClose(); delete m_pxObjectShell; } - if ( IsBound() ) + if (IsBound()) m_rBindings.Release(*this); m_pFloatingWindow.disposeAndClear(); m_pPopupWindow.disposeAndClear(); - m_aDocListBox.disposeAndClear(); + m_aDocListBox.clear(); m_aGlobalTree.disposeAndClear(); + m_aGlobalBox.clear(); m_aContentTree.disposeAndClear(); + m_aContentBox.clear(); m_aGlobalToolBox.disposeAndClear(); - m_aContentToolBox.disposeAndClear(); + m_xEdit.disposeAndClear(); + m_aContentToolBox.clear(); m_aPageChgIdle.Stop(); ::SfxControllerItem::dispose(); - vcl::Window::dispose(); + PanelLayout::dispose(); } void SwNavigationPI::SetPopupWindow( SfxPopupWindow* pWindow ) @@ -931,15 +840,14 @@ void SwNavigationPI::StateChanged( sal_uInt16 nSID, SfxItemState /*eState*/, SwWrtShell* pWrtShell = pActView->GetWrtShellPtr(); m_aContentTree->SetActiveShell(pWrtShell); bool bGlobal = IsGlobalDoc(); - m_aContentToolBox->EnableItem(FN_GLOBAL_SWITCH, bGlobal); - if( (!bGlobal && IsGlobalMode()) || - (!IsGlobalMode() && m_pConfig->IsGlobalActive()) ) + m_aContentToolBox->EnableItem(m_aContentToolBox->GetItemId("toggle"), bGlobal); + if ((!bGlobal && IsGlobalMode()) || (!IsGlobalMode() && m_pConfig->IsGlobalActive())) { ToggleTree(); } - if(bGlobal) + if (bGlobal) { - m_aGlobalToolBox->CheckItem(FN_GLOBAL_SAVE_CONTENT, pWrtShell->IsGlblDocSaveLinks()); + m_aGlobalToolBox->CheckItem(m_aGlobalToolBox->GetItemId("save"), pWrtShell->IsGlblDocSaveLinks()); } } else @@ -1195,28 +1103,34 @@ void SwNavigationPI::SetRegionDropMode(RegionMode nNewMode) m_nRegionMode = nNewMode; m_pConfig->SetRegionMode( m_nRegionMode ); - sal_uInt16 nDropId = FN_DROP_REGION; - if(m_nRegionMode == RegionMode::LINK) - nDropId = FN_DROP_REGION_LINK; - else if(m_nRegionMode == RegionMode::EMBEDDED) - nDropId = FN_DROP_REGION_COPY; - - ImageList& rImgLst = m_aContentImageList; - - m_aContentToolBox->SetItemImage( FN_DROP_REGION, rImgLst.GetImage(nDropId)); + sal_uInt16 nImageId = 0; + switch (nNewMode) + { + case RegionMode::NONE: + nImageId = RID_IMG_DROP_REGION; + break; + case RegionMode::LINK: + nImageId = RID_IMG_DROP_LINK; + break; + case RegionMode::EMBEDDED: + nImageId = RID_IMG_DROP_COPY; + break; + } + m_aContentToolBox->SetItemImage(m_aContentToolBox->GetItemId("dragmode"), Image(SW_RES(nImageId))); } -bool SwNavigationPI::ToggleTree() +void SwNavigationPI::ToggleTree() { - bool bRet = true; bool bGlobalDoc = IsGlobalDoc(); - if(!IsGlobalMode() && bGlobalDoc) + if (!IsGlobalMode() && bGlobalDoc) { SetUpdateMode(false); - if(IsZoomedIn()) + if (IsZoomedIn()) ZoomOut(); + m_aGlobalBox->Show(); m_aGlobalTree->ShowTree(); m_aGlobalToolBox->Show(); + m_aContentBox->Hide(); m_aContentTree->HideTree(); m_aContentToolBox->Hide(); m_aDocListBox->Hide(); @@ -1225,25 +1139,25 @@ bool SwNavigationPI::ToggleTree() } else { + m_aGlobalBox->Hide(); m_aGlobalTree->HideTree(); m_aGlobalToolBox->Hide(); - if(!IsZoomedIn()) + if (!IsZoomedIn()) { + m_aContentBox->Show(); m_aContentTree->ShowTree(); m_aContentToolBox->Show(); m_aDocListBox->Show(); } - bRet = false; SetGlobalMode(false); } - return bRet; } -bool SwNavigationPI::IsGlobalDoc() const +bool SwNavigationPI::IsGlobalDoc() const { bool bRet = false; SwView *pView = GetCreateView(); - if(pView) + if (pView) { SwWrtShell &rSh = pView->GetWrtShell(); bRet = rSh.IsGlobalDoc(); @@ -1262,17 +1176,17 @@ IMPL_LINK_NOARG(SwNavigationPI, ChangePageHdl, Idle *, void) IMPL_LINK_NOARG(SwNavigationPI, PageEditModifyHdl, SpinField&, void) { - if(m_aPageChgIdle.IsActive()) + if (m_aPageChgIdle.IsActive()) m_aPageChgIdle.Stop(); m_aPageChgIdle.Start(); } SwView* SwNavigationPI::GetCreateView() const { - if(!m_pCreateView) + if (!m_pCreateView) { SwView* pView = SwModule::GetFirstView(); - while(pView) + while (pView) { if(&pView->GetViewFrame()->GetBindings() == &m_rBindings) { @@ -1293,7 +1207,6 @@ SwNavigationChild::SwNavigationChild( vcl::Window* pParent, : SfxChildWindowContext( nId ) { VclPtr<SwNavigationPI> pNavi = VclPtr<SwNavigationPI>::Create( _pBindings, this, pParent ); - SetWindow( pNavi ); _pBindings->Invalidate(SID_NAVIGATOR); SwNavigationConfig* pNaviConfig = SW_MOD()->GetNavigationConfig(); @@ -1302,49 +1215,19 @@ SwNavigationChild::SwNavigationChild( vcl::Window* pParent, if( nRootType != ContentTypeId::UNKNOWN ) { pNavi->m_aContentTree->SetRootType(nRootType); - pNavi->m_aContentToolBox->CheckItem(FN_SHOW_ROOT); + pNavi->m_aContentToolBox->CheckItem(pNavi->m_aContentToolBox->GetItemId("root")); } pNavi->m_aContentTree->SetOutlineLevel( static_cast< sal_uInt8 >( pNaviConfig->GetOutlineLevel() ) ); pNavi->SetRegionDropMode( pNaviConfig->GetRegionMode() ); - if(GetFloatingWindow() && pNaviConfig->IsSmall()) + if (SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(pParent)) { - pNavi->ZoomIn(); + pNav->SetMinOutputSizePixel(pNavi->GetOptimalSize()); + if (pNaviConfig->IsSmall()) + pNavi->ZoomIn(); } -} -void SwNavigationPI::DataChanged( const DataChangedEvent& rDCEvt ) -{ - Window::DataChanged( rDCEvt ); - if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && - (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) ) - { - InitImageList(); - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - Color aBgColor = rStyleSettings.GetFaceColor(); - Wallpaper aBack( aBgColor ); - SetBackground( aBack ); - } -} - -void SwNavigationPI::InitImageList() -{ - ImageList& rImgLst = m_aContentImageList; - for( sal_uInt16 k = 0; k < m_aContentToolBox->GetItemCount(); k++) - m_aContentToolBox->SetItemImage(m_aContentToolBox->GetItemId(k), - rImgLst.GetImage(m_aContentToolBox->GetItemId(k))); - - for( sal_uInt16 k = 0; k < m_aGlobalToolBox->GetItemCount(); k++) - m_aGlobalToolBox->SetItemImage(m_aGlobalToolBox->GetItemId(k), - rImgLst.GetImage(m_aGlobalToolBox->GetItemId(k))); - - sal_uInt16 nDropId = FN_DROP_REGION; - if(m_nRegionMode == RegionMode::LINK) - nDropId = FN_DROP_REGION_LINK; - else if(m_nRegionMode == RegionMode::EMBEDDED) - nDropId = FN_DROP_REGION_COPY; - m_aContentToolBox->SetItemImage( FN_DROP_REGION, - rImgLst.GetImage(nDropId)); + SetWindow(pNavi); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/utlui/navipi.hrc b/sw/source/uibase/utlui/navipi.hrc index ec05d0cce65b..b8ca734fb9ef 100644 --- a/sw/source/uibase/utlui/navipi.hrc +++ b/sw/source/uibase/utlui/navipi.hrc @@ -16,8 +16,6 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#define IL_CONTENT 7 -#define TB_CONTENT 50 #define TL_CONTENT 51 #define LB_DOCS 53 #define TL_GLOBAL 55 diff --git a/sw/source/uibase/utlui/navipi.src b/sw/source/uibase/utlui/navipi.src index b97aaa3098a0..85c9feb881d2 100644 --- a/sw/source/uibase/utlui/navipi.src +++ b/sw/source/uibase/utlui/navipi.src @@ -24,276 +24,6 @@ #include "helpid.h" #include "access.hrc" -Window DLG_NAVIGATION_PI -{ - HelpID = HID_NAVIGATION_PI ; - OutputSize = TRUE ; - DialogControl = TRUE ; - SVLook = TRUE ; - Size = MAP_PIXEL ( 282 , 59 ) ; - Hide = TRUE ; - Text [ en-US ] = "Navigator" ; - ExtraData = - { - 198; - }; - - ImageList IL_CONTENT - { - Prefix = "sc"; - IdList = - { - FN_UP ; - FN_DOWN ; - FN_SELECT_HEADER ; - FN_SELECT_FOOTER ; - FN_SELECT_FOOTNOTE ; - FN_SHOW_CONTENT_BOX ; - FN_SHOW_ROOT ; - FN_ITEM_UP ; - FN_ITEM_DOWN ; - FN_ITEM_LEFT ; - FN_ITEM_RIGHT ; - FN_DROP_REGION ; - FN_OUTLINE_LEVEL ; - FN_SELECT_SET_AUTO_BOOKMARK ; - FN_DROP_REGION_LINK ; - FN_DROP_REGION_COPY ; - FN_GLOBAL_SWITCH ; - FN_GLOBAL_EDIT ; - FN_GLOBAL_UPDATE ; - FN_GLOBAL_OPEN ; - FN_GLOBAL_SAVE_CONTENT ; - FN_CREATE_NAVIGATION ; - }; - IdCount = { 21 ; }; - }; - Toolbox TB_CONTENT - { - Pos = MAP_PIXEL ( 5 , 5 ) ; - Size = MAP_PIXEL ( 300 , 47 ) ; - LineCount = 2 ; - ItemList = - { - ToolBoxItem - { - Identifier = FN_GLOBAL_SWITCH ; - HelpID = HID_NAVI_TBX17 ; - Text [ en-US ] = "Toggle Master View" ; - }; - ToolBoxItem - { - Identifier = FN_CREATE_NAVIGATION ; - HelpID = HID_NAVI_TBX24 ; - Text [ en-US ] = "Navigation" ; - DropDown = TRUE ; - }; - ToolBoxItem - { - Identifier = FN_UP ; - HelpID = HID_NAVI_TBX2 ; - Text [ en-US ] = "Back" ; - }; - ToolBoxItem - { - Identifier = FN_DOWN ; - HelpID = HID_NAVI_TBX3 ; - Text [ en-US ] = "Forward" ; - }; - ToolBoxItem - { - Identifier = FN_DROP_REGION ; - HelpID = HID_NAVI_TBX4 ; - DropDown = TRUE ; - Text [ en-US ] = "Drag Mode" ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_ITEM_UP ; - HelpID = HID_NAVI_TBX5 ; - Text [ en-US ] = "Promote Chapter" ; - }; - ToolBoxItem - { - Identifier = FN_ITEM_DOWN ; - HelpID = HID_NAVI_TBX6 ; - Text [ en-US ] = "Demote Chapter" ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_BREAK ; - }; - ToolBoxItem - { - Identifier = FN_SHOW_CONTENT_BOX ; - HelpID = HID_NAVI_TBX7 ; - Text [ en-US ] = "List Box On/Off" ; - }; - ToolBoxItem - { - Identifier = FN_SHOW_ROOT ; - HelpID = HID_NAVI_TBX8 ; - Text [ en-US ] = "Content Navigation View" ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_SELECT_SET_AUTO_BOOKMARK ; - HelpID = HID_NAVI_TBX9 ; - Text [ en-US ] = "Set Reminder" ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_SELECT_HEADER ; - HelpID = HID_NAVI_TBX10 ; - Text [ en-US ] = "Header" ; - }; - ToolBoxItem - { - Identifier = FN_SELECT_FOOTER ; - HelpID = HID_NAVI_TBX11 ; - Text [ en-US ] = "Footer" ; - }; - ToolBoxItem - { - Identifier = FN_SELECT_FOOTNOTE ; - HelpID = HID_NAVI_TBX12 ; - Text [ en-US ] = "Anchor<->Text" ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_OUTLINE_LEVEL ; - HelpID = HID_NAVI_TBX13 ; - Text [ en-US ] = "Heading Levels Shown" ; - DropDown = TRUE ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_ITEM_LEFT ; - HelpID = HID_NAVI_TBX14 ; - Text [ en-US ] = "Promote Level" ; - }; - ToolBoxItem - { - Identifier = FN_ITEM_RIGHT ; - HelpID = HID_NAVI_TBX15 ; - Text [ en-US ] = "Demote Level" ; - }; - }; - }; - ToolBox TB_GLOBAL - { - Pos = MAP_PIXEL ( 5 , 5 ) ; - Size = MAP_PIXEL ( 300 , 47 ) ; - LineCount = 1 ; - Hide = TRUE ; - ItemList = - { - ToolBoxItem - { - Identifier = FN_GLOBAL_SWITCH ; - HelpID = HID_NAVI_TBX17 ; - Text [ en-US ] = "Toggle Master View" ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_GLOBAL_EDIT ; - HelpID = HID_NAVI_TBX18 ; - Text [ en-US ] = "Edit" ; - }; - ToolBoxItem - { - Identifier = FN_GLOBAL_UPDATE ; - HelpID = HID_NAVI_TBX19 ; - Text [ en-US ] = "Update" ; - }; - ToolBoxItem - { - Identifier = FN_GLOBAL_OPEN ; - HelpID = HID_NAVI_TBX20 ; - Text [ en-US ] = "Insert" ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_GLOBAL_SAVE_CONTENT ; - HelpID = HID_NAVI_TBX21 ; - Text [ en-US ] = "Save Contents as well" ; - }; - ToolBoxItem - { - Type = TOOLBOXITEM_SEPARATOR ; - }; - ToolBoxItem - { - Identifier = FN_ITEM_UP ; - HelpID = HID_NAVI_TBX22 ; - Text [ en-US ] = "Move Up" ; - }; - ToolBoxItem - { - Identifier = FN_ITEM_DOWN ; - HelpID = HID_NAVI_TBX23 ; - Text [ en-US ] = "Move Down" ; - }; - }; - }; - /* TreeListBox */ - Control TL_CONTENT - { - HelpID = HID_NAVI_CONTENT ; - Border = TRUE ; - Pos = MAP_PIXEL ( 5 , 62 ) ; - Size = MAP_PIXEL ( 274 , 112 ) ; - TabStop = TRUE ; - ClipChildren = TRUE ; - Hide = TRUE ; - }; - Control TL_GLOBAL - { - HelpID = HID_NAVI_GLOBAL ; - Border = TRUE ; - Pos = MAP_PIXEL ( 5 , 34 ) ; - Size = MAP_PIXEL ( 274 , 112 ) ; - TabStop = TRUE ; - ClipChildren = TRUE ; - Hide = TRUE ; - }; - ListBox LB_DOCS - { - Border = TRUE ; - Pos = MAP_PIXEL ( 5 , 115 ) ; - Size = MAP_APPFONT ( 150 , 50 ) ; - DropDown = TRUE ; - }; -}; - ImageList IMG_NAVI_ENTRYBMP { Prefix = "nc"; @@ -315,6 +45,30 @@ ImageList IMG_NAVI_ENTRYBMP IdCount = { 12 ; }; }; +Image RID_IMG_DROP_REGION +{ + ImageBitmap = Bitmap + { + File = "sc20235.png" ; + }; +}; + +Image RID_IMG_DROP_LINK +{ + ImageBitmap = Bitmap + { + File = "sc20238.png" ; + }; +}; + +Image RID_IMG_DROP_COPY +{ + ImageBitmap = Bitmap + { + File = "sc20239.png" ; + }; +}; + String STR_ACCESS_TL_GLOBAL { Text [ en-US ] = "Global View"; diff --git a/sw/uiconfig/swriter/ui/navigatorpanel.ui b/sw/uiconfig/swriter/ui/navigatorpanel.ui new file mode 100644 index 000000000000..fe381ed47b2e --- /dev/null +++ b/sw/uiconfig/swriter/ui/navigatorpanel.ui @@ -0,0 +1,487 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.20.0 --> +<interface> + <requires lib="gtk+" version="3.0"/> + <object class="GtkGrid" id="NavigatorPanel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <child> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="border_width">6</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="swlo-SwNavHelpToolBox" id="content"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="toolbar_style">icons</property> + <child> + <object class="GtkToolButton" id="contenttoggle"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Toggle Master View</property> + <property name="action_name">toggle</property> + <property name="icon_name">sw/imglst/sc20244.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkMenuToolButton" id="navigation"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Navigation</property> + <property name="action_name">navigation</property> + <property name="icon_name">sw/imglst/sc20249.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="back"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Back</property> + <property name="action_name">back</property> + <property name="icon_name">sw/imglst/sc20186.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="forward"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Forward</property> + <property name="action_name">forward</property> + <property name="icon_name">sw/imglst/sc20175.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="dragmode"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Drag Mode</property> + <property name="action_name">dragmode</property> + <property name="icon_name">sw/imglst/sc20235.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkSeparatorToolItem" id="separator1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="chapterup"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Promote Chapter</property> + <property name="action_name">up</property> + <property name="icon_name">sw/imglst/sc20174.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="chapterdown"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Demote Chapter</property> + <property name="action_name">down</property> + <property name="icon_name">sw/imglst/sc20171.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="listbox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">List Box On/Off</property> + <property name="action_name">listbox</property> + <property name="icon_name">sw/imglst/sc20233.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="root"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Content Navigation View</property> + <property name="action_name">root</property> + <property name="icon_name">sw/imglst/sc20234.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkSeparatorToolItem" id="separator2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="reminder"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Set Reminder</property> + <property name="action_name">reminder</property> + <property name="icon_name">sw/imglst/sc20183.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkSeparatorToolItem" id="separator3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="header"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Header</property> + <property name="action_name">header</property> + <property name="icon_name">sw/imglst/sc20179.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="footer"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Footer</property> + <property name="action_name">footer</property> + <property name="icon_name">sw/imglst/sc20177.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="anchor"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Anchor<->Text</property> + <property name="action_name">anchor</property> + <property name="icon_name">sw/imglst/sc20182.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkSeparatorToolItem" id="separator4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkMenuToolButton" id="headings"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Heading Levels Shown</property> + <property name="action_name">headings</property> + <property name="icon_name">sw/imglst/sc20236.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkSeparatorToolItem" id="separator5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="promote"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Promote Level</property> + <property name="action_name">promote</property> + <property name="icon_name">sw/imglst/sc20172.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="demote"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Demote Level</property> + <property name="action_name">demote</property> + <property name="icon_name">sw/imglst/sc20173.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="documents"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Document</property> + <child internal-child="accessible"> + <object class="AtkObject" id="documents-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Active Window</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">4</property> + </packing> + </child> + <child> + <object class="GtkBox" id="contentbox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkToolbar" id="global"> + <property name="visible">False</property> + <property name="can_focus">False</property> + <property name="toolbar_style">icons</property> + <child> + <object class="GtkToolButton" id="globaltoggle"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Toggle Master View</property> + <property name="action_name">toggle</property> + <property name="icon_name">sw/imglst/sc20244.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkSeparatorToolItem" id="separator6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="edit"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Edit</property> + <property name="action_name">edit</property> + <property name="icon_name">sw/imglst/sc20245.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="update"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Update</property> + <property name="action_name">update</property> + <property name="icon_name">sw/imglst/sc20246.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="insert"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Insert</property> + <property name="action_name">insert</property> + <property name="icon_name">sw/imglst/sc20247.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkSeparatorToolItem" id="separator7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="save"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Save Contents as well</property> + <property name="action_name">save</property> + <property name="icon_name">sw/imglst/sc20248.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkSeparatorToolItem" id="separator8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="moveup"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Move Up</property> + <property name="action_name">up</property> + <property name="icon_name">sw/imglst/sc20174.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + <child> + <object class="GtkToolButton" id="movedown"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="tooltip_text" translatable="yes">Move Down</property> + <property name="action_name">down</property> + <property name="icon_name">sw/imglst/sc20171.png</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkBox" id="globalbox"> + <property name="visible">False</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="orientation">vertical</property> + <child> + <placeholder/> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + </object> +</interface> |