convert writer navigator to .ui format

Change-Id: I83f834ea050372362b50de61753c2b3e33c67778
This commit is contained in:
Caolán McNamara
2016-10-10 15:09:24 +01:00
parent 51e5e4970b
commit 33603a582b
16 changed files with 1088 additions and 1011 deletions

View File

@@ -745,6 +745,11 @@
<glade-widget-class title="Sidebar ToolBox" name="sfxlo-SidebarToolBox" <glade-widget-class title="Sidebar ToolBox" name="sfxlo-SidebarToolBox"
generic-name="Sidebar ToolBox" parent="GtkToolbar" generic-name="Sidebar ToolBox" parent="GtkToolbar"
icon-name="widget-gtk-toolbar"/> 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" <glade-widget-class title="Tab Stop Images" name="cuilo-TabWin_Impl"
generic-name="TabWin_Impl" parent="GtkDrawingArea" generic-name="TabWin_Impl" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/> icon-name="widget-gtk-drawingarea"/>

View File

@@ -129,6 +129,7 @@ public:
void SetNavigatorDlgFlag(bool isInNavigateDlg){ bisInNavigatoeDlg=isInNavigateDlg;}; void SetNavigatorDlgFlag(bool isInNavigateDlg){ bisInNavigatoeDlg=isInNavigateDlg;};
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
virtual void KeyInput( const KeyEvent& rKEvt ) override; virtual void KeyInput( const KeyEvent& rKEvt ) override;
virtual Size GetOptimalSize() const override;
void InitWindowBits( bool bButtons ); void InitWindowBits( bool bButtons );

View File

@@ -134,6 +134,11 @@ ScContentTree::ScContentTree(vcl::Window* pParent, ScNavigatorDlg* pNavigatorDlg
pTmpEntry= nullptr; pTmpEntry= nullptr;
} }
Size ScContentTree::GetOptimalSize() const
{
return LogicToPixel(Size(110, 100), MapUnit::MapAppFont);
}
ScContentTree::~ScContentTree() ScContentTree::~ScContentTree()
{ {
disposeOnce(); disposeOnce();

View File

@@ -83,11 +83,7 @@ ColumnEdit::~ColumnEdit()
disposeOnce(); disposeOnce();
} }
VCL_BUILDER_DECL_FACTORY(ColumnEdit) VCL_BUILDER_FACTORY_ARGS(ColumnEdit, WB_BORDER | WB_SPIN | WB_REPEAT | WB_RIGHT)
{
(void)rMap;
rRet = VclPtr<ColumnEdit>::Create(pParent, WB_BORDER | WB_SPIN | WB_REPEAT | WB_RIGHT);
}
bool ColumnEdit::Notify( NotifyEvent& rNEvt ) bool ColumnEdit::Notify( NotifyEvent& rNEvt )
{ {
@@ -264,11 +260,7 @@ RowEdit::~RowEdit()
disposeOnce(); disposeOnce();
} }
VCL_BUILDER_DECL_FACTORY(RowEdit) VCL_BUILDER_FACTORY_ARGS(RowEdit, WB_BORDER | WB_SPIN | WB_REPEAT | WB_RIGHT)
{
(void)rMap;
rRet = VclPtr<RowEdit>::Create(pParent, WB_BORDER | WB_SPIN | WB_REPEAT | WB_RIGHT);
}
bool RowEdit::Notify( NotifyEvent& rNEvt ) bool RowEdit::Notify( NotifyEvent& rNEvt )
{ {
@@ -417,9 +409,9 @@ void ScNavigatorDlg::UpdateButtons()
aTbxCmd->SetItemImage(nDragModeId, Image(ScResId(nImageId))); aTbxCmd->SetItemImage(nDragModeId, Image(ScResId(nImageId)));
} }
ScNavigatorSettings::ScNavigatorSettings() : ScNavigatorSettings::ScNavigatorSettings()
mnRootSelected( ScContentId::ROOT ), : mnRootSelected(ScContentId::ROOT)
mnChildSelected( SC_CONTENT_NOCHILD ) , mnChildSelected(SC_CONTENT_NOCHILD)
{ {
} }

View File

@@ -204,6 +204,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/mmselectpage \ sw/uiconfig/swriter/ui/mmselectpage \
sw/uiconfig/swriter/ui/mmsendmails \ sw/uiconfig/swriter/ui/mmsendmails \
sw/uiconfig/swriter/ui/mmsalutationpage \ sw/uiconfig/swriter/ui/mmsalutationpage \
sw/uiconfig/swriter/ui/navigatorpanel \
sw/uiconfig/swriter/ui/notebookbar \ sw/uiconfig/swriter/ui/notebookbar \
sw/uiconfig/swriter/ui/notebookbar_groups \ sw/uiconfig/swriter/ui/notebookbar_groups \
sw/uiconfig/swriter/ui/notebookbar_single \ sw/uiconfig/swriter/ui/notebookbar_single \

View File

@@ -115,24 +115,10 @@
#define FN_NEXT_BOOKMARK (FN_EDIT + 68) /* */ #define FN_NEXT_BOOKMARK (FN_EDIT + 68) /* */
#define FN_PREV_BOOKMARK (FN_EDIT + 69) /* */ #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_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_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_UPDATE_ALL_LINKS (FN_EDIT2 + 24) /* update all links */
#define FN_REDLINE_SHOW (FN_EDIT2 + 26) /* show Redlining */ #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 */ #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_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_SCROLL_NAVIGATION (FN_VIEW + 40) /* Navigation Controller */
#define FN_VIEW_HIDDEN_PARA (FN_VIEW + 42) /* View hidden paragraphs */ #define FN_VIEW_HIDDEN_PARA (FN_VIEW + 42) /* View hidden paragraphs */
#define FN_VIEW_SMOOTH_SCROLL (FN_VIEW + 43) #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_PREVIEW_ZOOM (FN_VIEW + 51) /* create table controller for zoom */
#define FN_SET_MODOPT_TBLNUMFMT (FN_VIEW + 52) /* Number recognition in tables */ #define FN_SET_MODOPT_TBLNUMFMT (FN_VIEW + 52) /* Number recognition in tables */

View File

@@ -43,30 +43,7 @@
#define HID_NAVIGATOR_TREELIST "SW_HID_NAVIGATOR_TREELIST" #define HID_NAVIGATOR_TREELIST "SW_HID_NAVIGATOR_TREELIST"
#define HID_NAVIGATOR_TOOLBOX "SW_HID_NAVIGATOR_TOOLBOX" #define HID_NAVIGATOR_TOOLBOX "SW_HID_NAVIGATOR_TOOLBOX"
#define HID_NAVIGATOR_LISTBOX "SW_HID_NAVIGATOR_LISTBOX" #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_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_GLOBAL_TOOLBOX "SW_HID_NAVIGATOR_GLOBAL_TOOLBOX"
#define HID_NAVIGATOR_GLOB_TREELIST "SW_HID_NAVIGATOR_GLOB_TREELIST" #define HID_NAVIGATOR_GLOB_TREELIST "SW_HID_NAVIGATOR_GLOB_TREELIST"
#define HID_GLBLTREE_UPDATE "SW_HID_GLBLTREE_UPDATE" #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_IDX "SW_HID_GLBLTREE_UPD_IDX"
#define HID_GLBLTREE_UPD_LINK "SW_HID_GLBLTREE_UPD_LINK" #define HID_GLBLTREE_UPD_LINK "SW_HID_GLBLTREE_UPD_LINK"
#define HID_GLBLTREEUPD_ALL "SW_HID_GLBLTREEUPD_ALL" #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_ACTION "SW_HID_SORT_ACTION"
#define HID_SORT_AUTHOR "SW_HID_SORT_AUTHOR" #define HID_SORT_AUTHOR "SW_HID_SORT_AUTHOR"
#define HID_SORT_DATE "SW_HID_SORT_DATE" #define HID_SORT_DATE "SW_HID_SORT_DATE"
@@ -172,13 +147,9 @@
// More Help-IDs // More Help-IDs
#define HID_EDIT_FORMULA "SW_HID_EDIT_FORMULA" #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_CALC_TOOLBOX "SW_HID_CALC_TOOLBOX"
#define HID_AUTOFORMAT_REJECT "SW_HID_AUTOFORMAT_REJECT" #define HID_AUTOFORMAT_REJECT "SW_HID_AUTOFORMAT_REJECT"
#define HID_AUTOFORMAT_ACCEPT "SW_HID_AUTOFORMAT_ACCEPT" #define HID_AUTOFORMAT_ACCEPT "SW_HID_AUTOFORMAT_ACCEPT"
#define HID_AUTOFORMAT_EDIT_CHG "SW_HID_AUTOFORMAT_EDIT_CHG" #define HID_AUTOFORMAT_EDIT_CHG "SW_HID_AUTOFORMAT_EDIT_CHG"

View File

@@ -55,6 +55,7 @@ class SwContentTree
: public SvTreeListBox : public SvTreeListBox
, public SfxListener , public SfxListener
{ {
VclPtr<SwNavigationPI> m_xDialog;
ImageList m_aEntryImages; ImageList m_aEntryImages;
OUString m_sSpace; OUString m_sSpace;
AutoTimer m_aUpdTimer; AutoTimer m_aUpdTimer;
@@ -156,7 +157,7 @@ protected:
virtual void ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) override; virtual void ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) override;
public: public:
SwContentTree(vcl::Window* pParent, const ResId& rResId); SwContentTree(vcl::Window* pParent, SwNavigationPI* pDialog);
virtual ~SwContentTree() override; virtual ~SwContentTree() override;
virtual void dispose() override; virtual void dispose() override;
OUString GetEntryAltText( SvTreeListEntry* pEntry ) const override; OUString GetEntryAltText( SvTreeListEntry* pEntry ) const override;
@@ -199,7 +200,7 @@ public:
virtual bool Collapse( SvTreeListEntry* pParent ) override; virtual bool Collapse( SvTreeListEntry* pParent ) override;
/** Execute commands of the Navigator */ /** Execute commands of the Navigator */
void ExecCommand(sal_uInt16 nCmd, bool bModifier); void ExecCommand(const OUString& rCmd, bool bModifier);
void ShowTree(); void ShowTree();
/** folded together will not be glidled */ /** folded together will not be glidled */
@@ -221,6 +222,7 @@ public:
virtual void KeyInput(const KeyEvent& rKEvt) override; virtual void KeyInput(const KeyEvent& rKEvt) override;
virtual bool Select( SvTreeListEntry* pEntry, bool bSelect=true ) 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 using Control::Notify; // FIXME why do we have 2 of these
virtual void Notify(SfxBroadcaster& rBC, SfxHint const& rHint) override; virtual void Notify(SfxBroadcaster& rBC, SfxHint const& rHint) override;
@@ -247,6 +249,7 @@ namespace sfx2 { class FileDialogHelper; }
class SwGlobalTree : public SvTreeListBox class SwGlobalTree : public SvTreeListBox
{ {
private: private:
VclPtr<SwNavigationPI> xDialog;
AutoTimer aUpdateTimer; AutoTimer aUpdateTimer;
OUString aContextStrings[GLOBAL_CONTEXT_COUNT]; OUString aContextStrings[GLOBAL_CONTEXT_COUNT];
@@ -330,9 +333,10 @@ protected:
virtual void ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) override; virtual void ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) override;
public: public:
SwGlobalTree(vcl::Window* pParent, const ResId& rResId); SwGlobalTree(vcl::Window* pParent, SwNavigationPI* pDialog);
virtual ~SwGlobalTree() override; virtual ~SwGlobalTree() override;
virtual void dispose() override; virtual void dispose() override;
virtual Size GetOptimalSize() const override;
void TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox); void TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox);
void InsertRegion( const SwGlblDocContent* pCont, void InsertRegion( const SwGlblDocContent* pCont,
@@ -342,7 +346,7 @@ public:
void ShowTree(); void ShowTree();
void HideTree(); void HideTree();
void ExecCommand(sal_uInt16 nCmd); void ExecCommand(const OUString& rCmd);
void Display(bool bOnlyUpdateUserData = false); void Display(bool bOnlyUpdateUserData = false);

View File

@@ -27,6 +27,7 @@
#include <sfx2/childwin.hxx> #include <sfx2/childwin.hxx>
#include <sfx2/ctrlitem.hxx> #include <sfx2/ctrlitem.hxx>
#include <sfx2/tbxctrl.hxx> #include <sfx2/tbxctrl.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <conttree.hxx> #include <conttree.hxx>
class SwWrtShell; class SwWrtShell;
@@ -38,19 +39,25 @@ class SwView;
class SwNavigationConfig; class SwNavigationConfig;
class SfxObjectShellLock; class SfxObjectShellLock;
class SfxChildWindowContext; class SfxChildWindowContext;
class SwNavigationPI;
enum class RegionMode; enum class RegionMode;
class SpinField; class SpinField;
class SwNavHelpToolBox : public ToolBox class SwNavHelpToolBox : public ToolBox
{ {
VclPtr<SwNavigationPI> m_xDialog;
virtual void MouseButtonDown(const MouseEvent &rEvt) override; virtual void MouseButtonDown(const MouseEvent &rEvt) override;
virtual void RequestHelp( const HelpEvent& rHEvt ) override; virtual void RequestHelp( const HelpEvent& rHEvt ) override;
public: virtual void dispose() override;
SwNavHelpToolBox(SwNavigationPI* pParent, const ResId &rResId); public:
SwNavHelpToolBox(Window* pParent);
void SetDialog(SwNavigationPI* pDialog)
{
m_xDialog = pDialog;
}
~SwNavHelpToolBox() override;
}; };
class SwNavigationPI : public vcl::Window, class SwNavigationPI : public PanelLayout,
public SfxControllerItem, public SfxListener public SfxControllerItem, public SfxListener
{ {
friend class SwNavigationChild; friend class SwNavigationChild;
@@ -59,8 +66,10 @@ class SwNavigationPI : public vcl::Window,
VclPtr<SwNavHelpToolBox> m_aContentToolBox; VclPtr<SwNavHelpToolBox> m_aContentToolBox;
VclPtr<ToolBox> m_aGlobalToolBox; VclPtr<ToolBox> m_aGlobalToolBox;
ImageList m_aContentImageList; VclPtr<NumEditAction> m_xEdit;
VclPtr<VclContainer> m_aContentBox;
VclPtr<SwContentTree> m_aContentTree; VclPtr<SwContentTree> m_aContentTree;
VclPtr<VclContainer> m_aGlobalBox;
VclPtr<SwGlobalTree> m_aGlobalTree; VclPtr<SwGlobalTree> m_aGlobalTree;
VclPtr<ListBox> m_aDocListBox; VclPtr<ListBox> m_aDocListBox;
Idle m_aPageChgIdle; Idle m_aPageChgIdle;
@@ -81,13 +90,9 @@ class SwNavigationPI : public vcl::Window,
SwNavigationConfig *m_pConfig; SwNavigationConfig *m_pConfig;
SfxBindings &m_rBindings; SfxBindings &m_rBindings;
long m_nDocLBIniHeight;
long m_nWishWidth;
sal_uInt16 m_nAutoMarkIdx; sal_uInt16 m_nAutoMarkIdx;
RegionMode m_nRegionMode; // 0 - URL, 1 - region with link 2 - region without link RegionMode m_nRegionMode; // 0 - URL, 1 - region with link 2 - region without link
short m_nZoomIn; Size m_aExpandedSize;
short m_nZoomOutInit;
short m_nZoomOut;
bool m_bIsZoomedIn : 1; bool m_bIsZoomedIn : 1;
bool m_bPageCtrlsVisible : 1; bool m_bPageCtrlsVisible : 1;
@@ -114,7 +119,6 @@ class SwNavigationPI : public vcl::Window,
DECL_LINK( ClosePopupWindow, SfxPopupWindow *, void ); DECL_LINK( ClosePopupWindow, SfxPopupWindow *, void );
void UsePage(); void UsePage();
void InitImageList();
void SetPopupWindow( SfxPopupWindow* ); void SetPopupWindow( SfxPopupWindow* );
using Window::Notify; using Window::Notify;
@@ -122,14 +126,11 @@ class SwNavigationPI : public vcl::Window,
protected: protected:
virtual void Resize() override;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
// release ObjectShellLock early enough for app end // release ObjectShellLock early enough for app end
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
NumEditAction& GetPageEdit(); NumEditAction& GetPageEdit();
bool ToggleTree(); void ToggleTree();
void SetGlobalMode(bool bSet) {m_bGlobalMode = bSet;} void SetGlobalMode(bool bSet) {m_bGlobalMode = bSet;}
public: public:

View File

@@ -145,8 +145,6 @@
#define RES_FRMEX_MENU (STR_AUTH_FIELD_END + 1) #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 IMG_NAVI_ENTRYBMP (RC_UTLUI_BEGIN + 4)
#define ILIST_DB_DLG (RC_UTLUI_BEGIN + 6) #define ILIST_DB_DLG (RC_UTLUI_BEGIN + 6)
@@ -157,6 +155,9 @@
#define IMG_VIEWLAYOUT_SINGLECOLUMN (RC_UTLUI_BEGIN + 16) #define IMG_VIEWLAYOUT_SINGLECOLUMN (RC_UTLUI_BEGIN + 16)
#define IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE (RC_UTLUI_BEGIN + 17) #define IMG_VIEWLAYOUT_SINGLECOLUMN_ACTIVE (RC_UTLUI_BEGIN + 17)
#define IMG_PAGE_BREAK (RC_UTLUI_BEGIN + 18) #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 //local ids of the Database ImageLists
#define IMG_COLLAPSE 18002 /*RID_SVXIMG_COLLAPSEDNODE*/ #define IMG_COLLAPSE 18002 /*RID_SVXIMG_COLLAPSEDNODE*/

View File

@@ -766,8 +766,9 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
} }
SwContentTree::SwContentTree(vcl::Window* pParent, const ResId& rResId) SwContentTree::SwContentTree(vcl::Window* pParent, SwNavigationPI* pDialog)
: SvTreeListBox(pParent, rResId) : SvTreeListBox(pParent)
, m_xDialog(pDialog)
, m_sSpace(OUString(" ")) , m_sSpace(OUString(" "))
, m_sRemoveIdx(SW_RES(STR_REMOVE_INDEX)) , m_sRemoveIdx(SW_RES(STR_REMOVE_INDEX))
, m_sUpdateIdx(SW_RES(STR_UPDATE)) , m_sUpdateIdx(SW_RES(STR_UPDATE))
@@ -833,9 +834,15 @@ void SwContentTree::dispose()
bIsInDrag = false; bIsInDrag = false;
m_aUpdTimer.Stop(); m_aUpdTimer.Stop();
SetActiveShell(nullptr); SetActiveShell(nullptr);
m_xDialog.clear();
SvTreeListBox::dispose(); SvTreeListBox::dispose();
} }
Size SwContentTree::GetOptimalSize() const
{
return LogicToPixel(Size(110, 112), MapUnit::MapAppFont);
}
OUString SwContentTree::GetEntryAltText( SvTreeListEntry* pEntry ) const OUString SwContentTree::GetEntryAltText( SvTreeListEntry* pEntry ) const
{ {
if( pEntry == nullptr) if( pEntry == nullptr)
@@ -1564,11 +1571,11 @@ void SwContentTree::Display( bool bActive )
m_bIsLastReadOnly = bReadOnly; m_bIsLastReadOnly = bReadOnly;
bool bDisable = pShell == nullptr || bReadOnly; bool bDisable = pShell == nullptr || bReadOnly;
SwNavigationPI* pNavi = GetParentWindow(); SwNavigationPI* pNavi = GetParentWindow();
pNavi->m_aContentToolBox->EnableItem(FN_ITEM_UP , !bDisable); pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("up"), !bDisable);
pNavi->m_aContentToolBox->EnableItem(FN_ITEM_DOWN, !bDisable); pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("down"), !bDisable);
pNavi->m_aContentToolBox->EnableItem(FN_ITEM_LEFT, !bDisable); pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("promote"), !bDisable);
pNavi->m_aContentToolBox->EnableItem(FN_ITEM_RIGHT, !bDisable); pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("demote"), !bDisable);
pNavi->m_aContentToolBox->EnableItem(FN_SELECT_SET_AUTO_BOOKMARK, !bDisable); pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("reminder"), !bDisable);
} }
if(pShell) if(pShell)
{ {
@@ -1890,7 +1897,8 @@ void SwContentTree::ToggleToRoot()
} }
} }
m_pConfig->SetRootType( m_nRootType ); 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() bool SwContentTree::HasContentChanged()
@@ -2218,17 +2226,14 @@ 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; const bool bUp = rCmd == "up";
switch( nCmd ) const bool bUpDown = bUp || rCmd == "up";
{ const bool bLeft = rCmd == "promote";
case FN_ITEM_DOWN: const bool bLeftRight = bLeft || rCmd == "demote";
case FN_ITEM_UP: if (!bUpDown && !bLeftRight)
bMove = true; return;
SAL_FALLTHROUGH;
case FN_ITEM_LEFT:
case FN_ITEM_RIGHT:
if( !GetWrtShell()->GetView().GetDocShell()->IsReadOnly() && if( !GetWrtShell()->GetView().GetDocShell()->IsReadOnly() &&
(m_bIsActive || (m_bIsActive ||
(m_bIsConstant && m_pActiveShell == GetParentWindow()->GetCreateView()->GetWrtShellPtr()))) (m_bIsConstant && m_pActiveShell == GetParentWindow()->GetCreateView()->GetWrtShellPtr())))
@@ -2247,16 +2252,16 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, bool bModifier)
} }
} }
if ( nActPos < USHRT_MAX && if ( nActPos < USHRT_MAX &&
( !bMove || pShell->IsOutlineMovable( nActPos )) ) ( !bUpDown || pShell->IsOutlineMovable( nActPos )) )
{ {
pShell->StartAllAction(); pShell->StartAllAction();
pShell->GotoOutline( nActPos); // If text selection != box selection pShell->GotoOutline( nActPos); // If text selection != box selection
pShell->Push(); pShell->Push();
pShell->MakeOutlineSel( nActPos, nActPos, pShell->MakeOutlineSel( nActPos, nActPos,
bModifier); bModifier);
if( bMove ) if (bUpDown)
{ {
short nDir = nCmd == FN_ITEM_UP ? -1 : 1; short nDir = bUp ? -1 : 1;
if( !bModifier && ( (nDir == -1 && nActPos > 0) || if( !bModifier && ( (nDir == -1 && nActPos > 0) ||
(nDir == 1 && nActPos < GetEntryCount() - 2) ) ) (nDir == 1 && nActPos < GetEntryCount() - 2) ) )
{ {
@@ -2338,7 +2343,7 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, bool bModifier)
else else
{ {
if( !pShell->IsProtectedOutlinePara() ) if( !pShell->IsProtectedOutlinePara() )
pShell->OutlineUpDown( nCmd == FN_ITEM_LEFT ? -1 : 1 ); pShell->OutlineUpDown(bLeft ? -1 : 1);
} }
pShell->ClearMark(); pShell->ClearMark();
@@ -2363,7 +2368,6 @@ void SwContentTree::ExecCommand(sal_uInt16 nCmd, bool bModifier)
} }
} }
} }
}
} }
void SwContentTree::ShowTree() void SwContentTree::ShowTree()
@@ -2995,10 +2999,10 @@ bool SwContentTree::Select( SvTreeListEntry* pEntry, bool bSelect )
} }
} }
SwNavigationPI* pNavi = GetParentWindow(); SwNavigationPI* pNavi = GetParentWindow();
pNavi->m_aContentToolBox->EnableItem(FN_ITEM_UP , bEnable); pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("up"), bEnable);
pNavi->m_aContentToolBox->EnableItem(FN_ITEM_DOWN, bEnable); pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("down"), bEnable);
pNavi->m_aContentToolBox->EnableItem(FN_ITEM_LEFT, bEnable); pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("promote"), bEnable);
pNavi->m_aContentToolBox->EnableItem(FN_ITEM_RIGHT,bEnable); pNavi->m_aContentToolBox->EnableItem(pNavi->m_aContentToolBox->GetItemId("demote"), bEnable);
return SvTreeListBox::Select(pEntry, bSelect); return SvTreeListBox::Select(pEntry, bSelect);
} }
@@ -3441,7 +3445,7 @@ void SwContentTree::DataChanged(const DataChangedEvent& rDCEvt)
SwNavigationPI* SwContentTree::GetParentWindow() SwNavigationPI* SwContentTree::GetParentWindow()
{ {
return static_cast<SwNavigationPI*>(Window::GetParent()); return m_xDialog;
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -144,21 +144,18 @@ void SwGlobalFrameListener_Impl::Notify( SfxBroadcaster& /*rBC*/, const SfxHint&
bValid = false; bValid = false;
} }
SwGlobalTree::SwGlobalTree(vcl::Window* pParent, const ResId& rResId) : SwGlobalTree::SwGlobalTree(vcl::Window* pParent, SwNavigationPI* pDialog)
: SvTreeListBox(pParent)
SvTreeListBox(pParent, rResId), , xDialog(pDialog)
, pActiveShell(nullptr)
pActiveShell ( nullptr ), , pEmphasisEntry(nullptr)
pEmphasisEntry ( nullptr ), , pDDSource(nullptr)
pDDSource ( nullptr ), , pSwGlblDocContents(nullptr)
pSwGlblDocContents ( nullptr ), , pDocContent(nullptr)
pDocContent ( nullptr ), , pDocInserter(nullptr)
pDocInserter ( nullptr ), , bIsInternalDrag(false)
, bLastEntryEmphasis(false)
bIsInternalDrag ( false ), , bIsImageListInitialized(false)
bLastEntryEmphasis ( false ),
bIsImageListInitialized ( false )
{ {
SetDragDropMode(DragDropMode::APP_COPY | SetDragDropMode(DragDropMode::APP_COPY |
DragDropMode::CTRL_MOVE | DragDropMode::CTRL_MOVE |
@@ -189,9 +186,15 @@ void SwGlobalTree::dispose()
delete pDocInserter; delete pDocInserter;
pDocInserter = nullptr; pDocInserter = nullptr;
aUpdateTimer.Stop(); aUpdateTimer.Stop();
xDialog.clear();
SvTreeListBox::dispose(); SvTreeListBox::dispose();
} }
Size SwGlobalTree::GetOptimalSize() const
{
return LogicToPixel(Size(110, 112), MapUnit::MapAppFont);
}
sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt )
{ {
sal_Int8 nRet = DND_ACTION_NONE; sal_Int8 nRet = DND_ACTION_NONE;
@@ -391,10 +394,11 @@ VclPtr<PopupMenu> SwGlobalTree::CreateContextMenu()
void SwGlobalTree::TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox) void SwGlobalTree::TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox)
{ {
const sal_uInt16 nEnableFlags = GetEnableFlags(); const sal_uInt16 nEnableFlags = GetEnableFlags();
if(FN_GLOBAL_OPEN == nTbxId) const OUString sCommand(pBox->GetItemCommand(nTbxId));
if (sCommand == "insert")
{ {
ScopedVclPtrInstance<PopupMenu> pMenu; 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->InsertItem( i, aContextStrings[STR_INDEX - STR_GLOBAL_CONTEXT_FIRST - CTX_INSERT_ANY_INDEX + i] );
pMenu->SetHelpId(i, aHelpForMenu[i] ); pMenu->SetHelpId(i, aHelpForMenu[i] );
@@ -409,7 +413,7 @@ void SwGlobalTree::TbxMenuHdl(sal_uInt16 nTbxId, ToolBox* pBox)
pBox->EndSelection(); pBox->EndSelection();
pBox->Invalidate(); pBox->Invalidate();
} }
else if(FN_GLOBAL_UPDATE == nTbxId) else if (sCommand == "update")
{ {
ScopedVclPtrInstance<PopupMenu> pMenu; ScopedVclPtrInstance<PopupMenu> pMenu;
for (sal_uInt16 i = CTX_UPDATE_SEL; i <= CTX_UPDATE_ALL; i++) for (sal_uInt16 i = CTX_UPDATE_SEL; i <= CTX_UPDATE_ALL; i++)
@@ -513,12 +517,12 @@ void SwGlobalTree::SelectHdl()
SwNavigationPI* pNavi = GetParentWindow(); SwNavigationPI* pNavi = GetParentWindow();
bool bReadonly = !pActiveShell || bool bReadonly = !pActiveShell ||
pActiveShell->GetView().GetDocShell()->IsReadOnly(); pActiveShell->GetView().GetDocShell()->IsReadOnly();
pNavi->m_aGlobalToolBox->EnableItem(FN_GLOBAL_EDIT, nSelCount == 1 && !bReadonly); pNavi->m_aGlobalToolBox->EnableItem(pNavi->m_aGlobalToolBox->GetItemId("edit"), nSelCount == 1 && !bReadonly);
pNavi->m_aGlobalToolBox->EnableItem(FN_GLOBAL_OPEN, nSelCount <= 1 && !bReadonly); pNavi->m_aGlobalToolBox->EnableItem(pNavi->m_aGlobalToolBox->GetItemId("insert"), nSelCount <= 1 && !bReadonly);
pNavi->m_aGlobalToolBox->EnableItem(FN_GLOBAL_UPDATE, GetEntryCount() > 0 && !bReadonly); pNavi->m_aGlobalToolBox->EnableItem(pNavi->m_aGlobalToolBox->GetItemId("update"), GetEntryCount() > 0 && !bReadonly);
pNavi->m_aGlobalToolBox->EnableItem(FN_ITEM_UP, pNavi->m_aGlobalToolBox->EnableItem(pNavi->m_aGlobalToolBox->GetItemId("up"),
nSelCount == 1 && nAbsPos && !bReadonly); 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); nSelCount == 1 && nAbsPos < GetEntryCount() - 1 && !bReadonly);
} }
@@ -1045,11 +1049,11 @@ void SwGlobalTree::HideTree()
SvTreeListBox::Hide(); SvTreeListBox::Hide();
} }
void SwGlobalTree::ExecCommand(sal_uInt16 nCmd) void SwGlobalTree::ExecCommand(const OUString &rCmd)
{ {
SvTreeListEntry* pEntry = FirstSelected(); SvTreeListEntry* pEntry = FirstSelected();
OSL_ENSURE(pEntry, "It explodes in the next moment"); OSL_ENSURE(pEntry, "It explodes in the next moment");
if(FN_GLOBAL_EDIT == nCmd) if (rCmd == "edit")
{ {
const SwGlblDocContent* pCont = static_cast<const SwGlblDocContent*>( const SwGlblDocContent* pCont = static_cast<const SwGlblDocContent*>(
pEntry->GetUserData()); pEntry->GetUserData());
@@ -1062,23 +1066,18 @@ void SwGlobalTree::ExecCommand(sal_uInt16 nCmd)
bool bMove = false; bool bMove = false;
sal_uLong nSource = GetModel()->GetAbsPos(pEntry); sal_uLong nSource = GetModel()->GetAbsPos(pEntry);
sal_uLong nDest = nSource; sal_uLong nDest = nSource;
switch(nCmd) if (rCmd == "down")
{
case FN_ITEM_DOWN:
{ {
sal_uLong nEntryCount = GetEntryCount(); sal_uLong nEntryCount = GetEntryCount();
bMove = nEntryCount > nSource + 1; bMove = nEntryCount > nSource + 1;
nDest+= 2; nDest+= 2;
} }
break; else if (rCmd == "up")
case FN_ITEM_UP:
{ {
if(nSource) if(nSource)
bMove = 0 != nSource; bMove = 0 != nSource;
nDest--; nDest--;
} }
break;
}
if( bMove && pActiveShell->MoveGlobalDocContent( if( bMove && pActiveShell->MoveGlobalDocContent(
*pSwGlblDocContents, nSource, nSource + 1, nDest ) && *pSwGlblDocContents, nSource, nSource + 1, nDest ) &&
Update( false )) Update( false ))
@@ -1209,7 +1208,7 @@ IMPL_LINK_NOARG( SwGlobalTree, DoubleClickHdl, SvTreeListBox*, bool)
SwNavigationPI* SwGlobalTree::GetParentWindow() SwNavigationPI* SwGlobalTree::GetParentWindow()
{ {
return static_cast<SwNavigationPI*>(Window::GetParent()); return xDialog;
} }
IMPL_STATIC_LINK_NOARG(SwGlobalTree, ShowFrameHdl, void*, void) IMPL_STATIC_LINK_NOARG(SwGlobalTree, ShowFrameHdl, void*, void)

View File

@@ -21,7 +21,9 @@
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#include <svl/urlbmk.hxx> #include <svl/urlbmk.hxx>
#include <svl/stritem.hxx> #include <svl/stritem.hxx>
#include <vcl/builderfactory.hxx>
#include <vcl/graphicfilter.hxx> #include <vcl/graphicfilter.hxx>
#include <vcl/layout.hxx>
#include <svl/urihelper.hxx> #include <svl/urihelper.hxx>
#include <sot/formats.hxx> #include <sot/formats.hxx>
#include <sot/filelist.hxx> #include <sot/filelist.hxx>
@@ -29,6 +31,7 @@
#include <sfx2/imgmgr.hxx> #include <sfx2/imgmgr.hxx>
#include <sfx2/dispatch.hxx> #include <sfx2/dispatch.hxx>
#include <sfx2/dockwin.hxx> #include <sfx2/dockwin.hxx>
#include <sfx2/navigat.hxx>
#include <vcl/toolbox.hxx> #include <vcl/toolbox.hxx>
#include <vcl/settings.hxx> #include <vcl/settings.hxx>
#include <swtypes.hxx> #include <swtypes.hxx>
@@ -212,6 +215,7 @@ void SwNavigationPI::UsePage()
IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox, void ) IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox, void )
{ {
const sal_uInt16 nCurrItemId = pBox->GetCurItemId(); const sal_uInt16 nCurrItemId = pBox->GetCurItemId();
const OUString sCommand = pBox->GetItemCommand(nCurrItemId);
SwView *pView = GetCreateView(); SwView *pView = GetCreateView();
if (!pView) if (!pView)
return; return;
@@ -223,26 +227,27 @@ IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox, void )
bool bOutlineWithChildren = ( KEY_MOD1 != pBox->GetModifier()); bool bOutlineWithChildren = ( KEY_MOD1 != pBox->GetModifier());
int nFuncId = 0; int nFuncId = 0;
bool bFocusToDoc = false; 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 // #i75416# move the execution of the search to an asynchronously called static link
bool* pbNext = new bool( FN_DOWN == nCurrItemId ); bool* pbNext = new bool(false);
Application::PostUserEvent( LINK(pView, SwView, MoveNavigationHdl), pbNext, true ); Application::PostUserEvent(LINK(pView, SwView, MoveNavigationHdl), pbNext, true);
} }
break; if (sCommand == "forward")
case FN_SHOW_ROOT: {
// #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(); m_aContentTree->ToggleToRoot();
} }
break; else if (sCommand == "listbox")
case FN_SHOW_CONTENT_BOX:
case FN_SELECT_CONTENT:
if(m_pContextWin!=nullptr && m_pContextWin->GetFloatingWindow()!=nullptr)
{ {
if(IsZoomedIn() ) if (m_pContextWin && m_pContextWin->GetFloatingWindow())
{
if (IsZoomedIn())
{ {
ZoomOut(); ZoomOut();
} }
@@ -252,9 +257,9 @@ IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox, void )
} }
} }
return; return;
}
// Functions that will trigger a direct action. // Functions that will trigger a direct action.
else if (sCommand == "footer")
case FN_SELECT_FOOTER:
{ {
rSh.MoveCursor(); rSh.MoveCursor();
const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false); const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false);
@@ -267,8 +272,7 @@ IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox, void )
nFuncId = FN_TO_FOOTER; nFuncId = FN_TO_FOOTER;
bFocusToDoc = true; bFocusToDoc = true;
} }
break; else if (sCommand == "header")
case FN_SELECT_HEADER:
{ {
rSh.MoveCursor(); rSh.MoveCursor();
const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false); const FrameTypeFlags eType = rSh.GetFrameType(nullptr,false);
@@ -281,8 +285,7 @@ IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox, void )
nFuncId = FN_TO_HEADER; nFuncId = FN_TO_HEADER;
bFocusToDoc = true; bFocusToDoc = true;
} }
break; else if (sCommand == "anchor")
case FN_SELECT_FOOTNOTE:
{ {
rSh.MoveCursor(); rSh.MoveCursor();
const FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,false); const FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,false);
@@ -306,42 +309,36 @@ IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox, void )
} }
bFocusToDoc = true; bFocusToDoc = true;
} }
break; else if (sCommand == "reminder")
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:
{ {
if(IsGlobalMode()) MakeMark();
m_aGlobalTree->ExecCommand(nCurrItemId);
else
m_aContentTree->ExecCommand(nCurrItemId, bOutlineWithChildren);
} }
break; else if (sCommand == "down" ||
case FN_GLOBAL_SWITCH: 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(); ToggleTree();
m_pConfig->SetGlobalActive(IsGlobalMode()); m_pConfig->SetGlobalActive(IsGlobalMode());
} }
break; else if (sCommand == "save")
case FN_GLOBAL_SAVE_CONTENT:
{ {
bool bSave = rSh.IsGlblDocSaveLinks(); bool bSave = rSh.IsGlblDocSaveLinks();
rSh.SetGlblDocSaveLinks( !bSave ); rSh.SetGlblDocSaveLinks( !bSave );
pBox->CheckItem(FN_GLOBAL_SAVE_CONTENT, !bSave ); pBox->CheckItem(nCurrItemId, !bSave );
}
break;
} }
if (nFuncId) if (nFuncId)
{
lcl_UnSelectFrame(&rSh); lcl_UnSelectFrame(&rSh);
} if (bFocusToDoc)
if(bFocusToDoc)
pView->GetEditWin().GrabFocus(); pView->GetEditWin().GrabFocus();
} }
@@ -350,29 +347,18 @@ IMPL_LINK( SwNavigationPI, ToolBoxSelectHdl, ToolBox *, pBox, void )
IMPL_LINK( SwNavigationPI, ToolBoxClickHdl, ToolBox *, pBox, void ) IMPL_LINK( SwNavigationPI, ToolBoxClickHdl, ToolBox *, pBox, void )
{ {
const sal_uInt16 nCurrItemId = pBox->GetCurItemId(); const sal_uInt16 nCurrItemId = pBox->GetCurItemId();
switch (nCurrItemId) const OUString sCommand = pBox->GetItemCommand(nCurrItemId);
{ if (sCommand == "update" || sCommand == "insert")
case FN_GLOBAL_UPDATE:
case FN_GLOBAL_OPEN:
{
m_aGlobalTree->TbxMenuHdl(nCurrItemId, pBox); m_aGlobalTree->TbxMenuHdl(nCurrItemId, pBox);
}
break;
}
} }
IMPL_LINK( SwNavigationPI, ToolBoxDropdownClickHdl, ToolBox*, pBox, void ) IMPL_LINK( SwNavigationPI, ToolBoxDropdownClickHdl, ToolBox*, pBox, void )
{ {
const sal_uInt16 nCurrItemId = pBox->GetCurItemId(); const sal_uInt16 nCurrItemId = pBox->GetCurItemId();
switch (nCurrItemId) const OUString sCommand = pBox->GetItemCommand(nCurrItemId);
{ if (sCommand == "navigation")
case FN_CREATE_NAVIGATION: CreateNavigationTool(pBox->GetItemRect(nCurrItemId), true, this);
{ else if (sCommand == "dragmode")
CreateNavigationTool(pBox->GetItemRect(FN_CREATE_NAVIGATION), true, this);
}
break;
case FN_DROP_REGION:
{ {
static const char* aHIDs[] = static const char* aHIDs[] =
{ {
@@ -388,17 +374,14 @@ IMPL_LINK( SwNavigationPI, ToolBoxDropdownClickHdl, ToolBox*, pBox, void )
} }
pMenu->CheckItem( static_cast<int>(m_nRegionMode) + 1 ); pMenu->CheckItem( static_cast<int>(m_nRegionMode) + 1 );
pMenu->SetSelectHdl(LINK(this, SwNavigationPI, MenuSelectHdl)); pMenu->SetSelectHdl(LINK(this, SwNavigationPI, MenuSelectHdl));
pBox->SetItemDown( nCurrItemId, true ); pBox->SetItemDown(nCurrItemId, true);
pMenu->Execute( pBox, pMenu->Execute(pBox, pBox->GetItemRect(nCurrItemId), PopupMenuFlags::ExecuteDown);
pBox->GetItemRect(FN_DROP_REGION), pBox->SetItemDown(nCurrItemId, false);
PopupMenuFlags::ExecuteDown );
pBox->SetItemDown( nCurrItemId, false );
pBox->EndSelection(); pBox->EndSelection();
pMenu.disposeAndClear(); pMenu.disposeAndClear();
pBox->Invalidate(); pBox->Invalidate();
} }
break; else if (sCommand == "headings")
case FN_OUTLINE_LEVEL:
{ {
ScopedVclPtrInstance<PopupMenu> pMenu; ScopedVclPtrInstance<PopupMenu> pMenu;
for (sal_uInt16 i = 101; i <= 100 + MAXLEVEL; ++i) for (sal_uInt16 i = 101; i <= 100 + MAXLEVEL; ++i)
@@ -409,30 +392,29 @@ IMPL_LINK( SwNavigationPI, ToolBoxDropdownClickHdl, ToolBox*, pBox, void )
pMenu->CheckItem( m_aContentTree->GetOutlineLevel() + 100 ); pMenu->CheckItem( m_aContentTree->GetOutlineLevel() + 100 );
pMenu->SetSelectHdl(LINK(this, SwNavigationPI, MenuSelectHdl)); pMenu->SetSelectHdl(LINK(this, SwNavigationPI, MenuSelectHdl));
pBox->SetItemDown( nCurrItemId, true ); pBox->SetItemDown( nCurrItemId, true );
pMenu->Execute( pBox, pMenu->Execute(pBox, pBox->GetItemRect(nCurrItemId), PopupMenuFlags::ExecuteDown);
pBox->GetItemRect(FN_OUTLINE_LEVEL),
PopupMenuFlags::ExecuteDown );
pBox->SetItemDown( nCurrItemId, false ); pBox->SetItemDown( nCurrItemId, false );
pMenu.disposeAndClear(); pMenu.disposeAndClear();
pBox->EndSelection(); pBox->EndSelection();
pBox->Invalidate(); pBox->Invalidate();
} }
break;
}
} }
SwNavHelpToolBox::SwNavHelpToolBox(SwNavigationPI* pParent, const ResId &rResId) SwNavHelpToolBox::SwNavHelpToolBox(Window* pParent)
: ToolBox(pParent, rResId) : ToolBox(pParent)
{} {
}
VCL_BUILDER_FACTORY(SwNavHelpToolBox)
void SwNavHelpToolBox::MouseButtonDown(const MouseEvent &rEvt) void SwNavHelpToolBox::MouseButtonDown(const MouseEvent &rEvt)
{ {
if(rEvt.GetButtons() == MOUSE_LEFT && sal_uInt16 nItemId = GetItemId(rEvt.GetPosPixel());
FN_CREATE_NAVIGATION == 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);
} }
@@ -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())); const sal_uInt16 nItemId = GetItemId(ScreenToOutputPixel(rHEvt.GetMousePosPixel()));
if( FN_UP == nItemId || FN_DOWN == nItemId ) const OUString sCommand(GetItemCommand(nItemId));
{ if (sCommand == "back")
SetItemText(nItemId, SwScrollNaviPopup::GetQuickHelpText((FN_DOWN == nItemId))); SetQuickHelpText(nItemId, SwScrollNaviPopup::GetQuickHelpText(false));
} else if (sCommand == "forward")
SetQuickHelpText(nItemId, SwScrollNaviPopup::GetQuickHelpText(true));
ToolBox::RequestHelp(rHEvt); ToolBox::RequestHelp(rHEvt);
} }
void SwNavHelpToolBox::dispose()
{
m_xDialog.clear();
ToolBox::dispose();
}
SwNavHelpToolBox::~SwNavHelpToolBox()
{
disposeOnce();
}
// Action-Handler Edit: // Action-Handler Edit:
// Switches to the page if the structure view is not turned on. // Switches to the page if the structure view is not turned on.
@@ -527,260 +521,167 @@ void SwNavigationPI::MakeMark()
void SwNavigationPI::ZoomOut() void SwNavigationPI::ZoomOut()
{ {
if (IsZoomedIn()) if (!IsZoomedIn())
{ return;
FloatingWindow* pFloat = m_pContextWin!=nullptr ? m_pContextWin->GetFloatingWindow() : nullptr; SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(GetParent());
if (!pNav)
return;
m_bIsZoomedIn = false; 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(); FillBox();
if(IsGlobalMode()) if (IsGlobalMode())
{ {
m_aGlobalBox->Show();
m_aGlobalTree->ShowTree(); m_aGlobalTree->ShowTree();
} }
else else
{ {
m_aContentBox->Show();
m_aContentTree->ShowTree(); m_aContentTree->ShowTree();
m_aDocListBox->Show(); 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(); SvTreeListEntry* pFirst = m_aContentTree->FirstSelected();
if(pFirst) if (pFirst)
m_aContentTree->Select(pFirst); // Enable toolbox m_aContentTree->Select(pFirst); // Enable toolbox
m_pConfig->SetSmall( false ); m_pConfig->SetSmall(false);
m_aContentToolBox->CheckItem(FN_SHOW_CONTENT_BOX); m_aContentToolBox->CheckItem(m_aContentToolBox->GetItemId("listbox"));
}
} }
void SwNavigationPI::ZoomIn() void SwNavigationPI::ZoomIn()
{ {
if (m_pContextWin != nullptr) if (IsZoomedIn())
{ return;
FloatingWindow* pFloat = m_pContextWin->GetFloatingWindow(); SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(GetParent());
if (pFloat && if (!pNav)
(!IsZoomedIn() || ( m_pContextWin->GetFloatingWindow()->IsRollUp()))) return;
{
m_aExpandedSize = GetSizePixel();
m_aContentBox->Hide();
m_aContentTree->HideTree(); m_aContentTree->HideTree();
m_aDocListBox->Hide(); m_aGlobalBox->Hide();
m_aGlobalTree->HideTree(); m_aGlobalTree->HideTree();
m_aDocListBox->Hide();
m_bIsZoomedIn = true; m_bIsZoomedIn = true;
Size aSz(GetOutputSizePixel());
if( aSz.Height() > m_nZoomIn )
m_nZoomOut = ( short ) aSz.Height();
aSz.Height() = m_nZoomIn; Size aOptimalSize(GetOptimalSize());
Size aMinOutSizePixel = static_cast<SfxDockingWindow*>(GetParent())->GetMinOutputSizePixel(); Size aNewSize(pNav->GetOutputSizePixel());
static_cast<SfxDockingWindow*>(GetParent())->SetMinOutputSizePixel(Size( aNewSize.Height() = aOptimalSize.Height();
aMinOutSizePixel.Width(), aSz.Height())); pNav->SetMinOutputSizePixel(aOptimalSize);
pFloat->SetOutputSizePixel(aSz); pNav->SetOutputSizePixel(aNewSize);
SvTreeListEntry* pFirst = m_aContentTree->FirstSelected(); SvTreeListEntry* pFirst = m_aContentTree->FirstSelected();
if(pFirst) if (pFirst)
m_aContentTree->Select(pFirst); // Enable toolbox m_aContentTree->Select(pFirst); // Enable toolbox
m_pConfig->SetSmall( true ); m_pConfig->SetSmall(true);
m_aContentToolBox->CheckItem(FN_SHOW_CONTENT_BOX, false); m_aContentToolBox->CheckItem(m_aContentToolBox->GetItemId("listbox"), false);
}
}
} }
void SwNavigationPI::Resize() SwNavigationPI::SwNavigationPI(SfxBindings* _pBindings,
{
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);
}
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);
}
}
SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
SfxChildWindowContext* pCw, SfxChildWindowContext* pCw,
vcl::Window* pParent) : vcl::Window* pParent)
: PanelLayout(pParent, "NavigatorPanel", "modules/swriter/ui/navigatorpanel.ui", nullptr)
Window( pParent, SW_RES(DLG_NAVIGATION_PI)), , SfxControllerItem(SID_DOCFULLNAME, *_pBindings)
SfxControllerItem( SID_DOCFULLNAME, *_pBindings ), , m_pxObjectShell(nullptr)
, m_pContentView(nullptr)
m_aContentToolBox(VclPtr<SwNavHelpToolBox>::Create(this, SW_RES(TB_CONTENT))), , m_pContentWrtShell(nullptr)
m_aGlobalToolBox(VclPtr<ToolBox>::Create(this, SW_RES(TB_GLOBAL))), , m_pActContView(nullptr)
m_aContentImageList(SW_RES(IL_CONTENT)), , m_pCreateView(nullptr)
m_aContentTree(VclPtr<SwContentTree>::Create(this, SW_RES(TL_CONTENT))), , m_pPopupWindow(nullptr)
m_aGlobalTree(VclPtr<SwGlobalTree>::Create(this, SW_RES(TL_GLOBAL))), , m_pFloatingWindow(nullptr)
m_aDocListBox(VclPtr<ListBox>::Create(this, SW_RES(LB_DOCS))), , m_pContextWin(pCw)
, m_pConfig(SW_MOD()->GetNavigationConfig())
m_pxObjectShell(nullptr), , m_rBindings(*_pBindings)
m_pContentView(nullptr), , m_nAutoMarkIdx(1)
m_pContentWrtShell(nullptr), , m_nRegionMode(RegionMode::NONE)
m_pActContView(nullptr), , m_bIsZoomedIn(false)
m_pCreateView(nullptr), , m_bPageCtrlsVisible(false)
m_pPopupWindow(nullptr), , m_bGlobalMode(false)
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)
{ {
GetCreateView(); get(m_aContentToolBox, "content");
InitImageList(); m_aContentToolBox->SetLineCount(2);
m_aContentToolBox->InsertBreak(8);
m_aContentToolBox->SetDialog(this);
get(m_aGlobalToolBox, "global");
get(m_aDocListBox, "documents");
m_aContentToolBox->SetHelpId(HID_NAVIGATOR_TOOLBOX ); 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();
m_aContentToolBox->SetHelpId(HID_NAVIGATOR_TOOLBOX);
m_aGlobalToolBox->SetHelpId(HID_NAVIGATOR_GLOBAL_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_aDocListBox->SetDropDownLineCount(9);
m_nDocLBIniHeight = m_aDocListBox->GetSizePixel().Height();
m_nZoomOutInit = m_nZoomOut = Resource::ReadShortRes();
// Insert the numeric field in the toolbox. // 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); m_aContentToolBox.get(), WB_BORDER|WB_TABSTOP|WB_LEFT|WB_REPEAT|WB_SPIN);
pEdit->SetActionHdl(LINK(this, SwNavigationPI, EditAction)); m_xEdit->SetMin(1);
pEdit->SetGetFocusHdl(LINK(this, SwNavigationPI, EditGetFocus)); m_xEdit->SetFirst(1);
pEdit->SetAccessibleName(pEdit->GetQuickHelpText()); m_xEdit->SetActionHdl(LINK(this, SwNavigationPI, EditAction));
pEdit->SetUpHdl(LINK(this, SwNavigationPI, PageEditModifyHdl)); m_xEdit->SetGetFocusHdl(LINK(this, SwNavigationPI, EditGetFocus));
pEdit->SetDownHdl(LINK(this, SwNavigationPI, PageEditModifyHdl)); m_xEdit->SetAccessibleName(m_xEdit->GetQuickHelpText());
m_xEdit->SetUpHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
m_xEdit->SetDownHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
m_bPageCtrlsVisible = true; m_bPageCtrlsVisible = true;
// Double separators are not allowed, so you have to // Double separators are not allowed, so you have to
// determine the suitable size differently. // determine the suitable size differently.
Rectangle aFirstRect = m_aContentToolBox->GetItemRect(FN_SELECT_FOOTNOTE); Rectangle aFirstRect = m_aContentToolBox->GetItemRect(m_aContentToolBox->GetItemId("anchor"));
Rectangle aSecondRect = m_aContentToolBox->GetItemRect(FN_SELECT_HEADER); Rectangle aSecondRect = m_aContentToolBox->GetItemRect(m_aContentToolBox->GetItemId("header"));
Size aItemWinSize( aFirstRect.Left() - aSecondRect.Left(), Size aItemWinSize( aFirstRect.Left() - aSecondRect.Left(),
aFirstRect.Bottom() - aFirstRect.Top() ); 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()); aItemWinSize.Width() = std::max(aItemWinSize.Width(), aOptimalSize.Width());
pEdit->SetSizePixel(aItemWinSize); m_xEdit->SetSizePixel(aItemWinSize);
m_aContentToolBox->InsertSeparator(4); 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->InsertSeparator(4);
m_aContentToolBox->SetHelpId(FN_PAGENUMBER, HID_NAVI_TBX16); m_aContentToolBox->SetHelpId(FN_PAGENUMBER, "modules/swriter/ui/navigatorpanel/numericfield");
m_aContentToolBox->ShowItem( FN_PAGENUMBER ); m_aContentToolBox->ShowItem(FN_PAGENUMBER);
if(!IsGlobalDoc()){ if (!IsGlobalDoc())
m_aContentToolBox->HideItem( FN_GLOBAL_SWITCH ); {
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_aContextArr[i] = SW_RESSTR(STR_HYPERLINK + i);
m_aStatusArr[i] = SW_RESSTR(STR_STATUS_FIRST + i); m_aStatusArr[i] = SW_RESSTR(STR_STATUS_FIRST + i);
} }
m_aStatusArr[3] = SW_RESSTR(STR_ACTIVE_VIEW); m_aStatusArr[3] = SW_RESSTR(STR_ACTIVE_VIEW);
FreeResource();
const Size& rOutSize = GetOutputSizePixel(); m_aContentTree->SetStyle(m_aContentTree->GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT|
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_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 ); WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
m_aContentTree->SetSpaceBetweenEntries(3); m_aContentTree->SetSpaceBetweenEntries(3);
m_aContentTree->SetSelectionMode( SelectionMode::Single ); m_aContentTree->SetSelectionMode(SelectionMode::Single);
m_aContentTree->SetDragDropMode( DragDropMode::CTRL_MOVE | m_aContentTree->SetDragDropMode(DragDropMode::CTRL_MOVE |
DragDropMode::CTRL_COPY | DragDropMode::CTRL_COPY |
DragDropMode::ENABLE_TOP ); DragDropMode::ENABLE_TOP);
m_aContentTree->EnableAsyncDrag(true); m_aContentTree->EnableAsyncDrag(true);
m_aContentTree->ShowTree(); m_aContentTree->ShowTree();
m_aContentToolBox->CheckItem(FN_SHOW_CONTENT_BOX); m_aContentToolBox->CheckItem(m_aContentToolBox->GetItemId("listbox"));
// TreeListBox for global document // TreeListBox for global document
m_aGlobalTree->setPosSizePixel( 0, nListboxYPos, 0, 0, PosSizeFlags::Y );
m_aGlobalTree->SetSelectionMode( SelectionMode::Multiple ); m_aGlobalTree->SetSelectionMode( SelectionMode::Multiple );
m_aGlobalTree->SetStyle( m_aGlobalTree->GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT| m_aGlobalTree->SetStyle(m_aGlobalTree->GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT|
WB_CLIPCHILDREN|WB_HSCROLL ); WB_CLIPCHILDREN|WB_HSCROLL);
Size aGlblSize(m_aGlobalToolBox->CalcWindowSizePixel());
m_aGlobalToolBox->SetSizePixel(aGlblSize);
// Handler // Handler
Link<ToolBox *, void> aLk = LINK(this, SwNavigationPI, ToolBoxSelectHdl); Link<ToolBox *, void> aLk = LINK(this, SwNavigationPI, ToolBoxSelectHdl);
m_aContentToolBox->SetSelectHdl( aLk ); m_aContentToolBox->SetSelectHdl( aLk );
m_aGlobalToolBox->SetSelectHdl( aLk ); m_aGlobalToolBox->SetSelectHdl( aLk );
@@ -790,7 +691,7 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
m_aContentToolBox->SetDropdownClickHdl( LINK(this, SwNavigationPI, ToolBoxDropdownClickHdl) ); m_aContentToolBox->SetDropdownClickHdl( LINK(this, SwNavigationPI, ToolBoxDropdownClickHdl) );
m_aGlobalToolBox->SetClickHdl( LINK(this, SwNavigationPI, ToolBoxClickHdl) ); m_aGlobalToolBox->SetClickHdl( LINK(this, SwNavigationPI, ToolBoxClickHdl) );
m_aGlobalToolBox->SetDropdownClickHdl( LINK(this, SwNavigationPI, ToolBoxDropdownClickHdl) ); m_aGlobalToolBox->SetDropdownClickHdl( LINK(this, SwNavigationPI, ToolBoxDropdownClickHdl) );
m_aGlobalToolBox->CheckItem(FN_GLOBAL_SWITCH); m_aGlobalToolBox->CheckItem(m_aGlobalToolBox->GetItemId("toggle"));
vcl::Font aFont(GetFont()); vcl::Font aFont(GetFont());
aFont.SetWeight(WEIGHT_NORMAL); aFont.SetWeight(WEIGHT_NORMAL);
@@ -807,16 +708,19 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
pImgMan->RegisterToolBox(m_aContentToolBox.get(), SfxToolboxFlags::CHANGEOUTSTYLE); pImgMan->RegisterToolBox(m_aContentToolBox.get(), SfxToolboxFlags::CHANGEOUTSTYLE);
pImgMan->RegisterToolBox(m_aGlobalToolBox.get(), SfxToolboxFlags::CHANGEOUTSTYLE); pImgMan->RegisterToolBox(m_aGlobalToolBox.get(), SfxToolboxFlags::CHANGEOUTSTYLE);
m_aContentToolBox->SetItemBits( FN_CREATE_NAVIGATION, m_aContentToolBox->GetItemBits( FN_CREATE_NAVIGATION ) | ToolBoxItemBits::DROPDOWNONLY ); sal_uInt16 nNavId = m_aContentToolBox->GetItemId("navigation");
m_aContentToolBox->SetItemBits( FN_DROP_REGION, m_aContentToolBox->GetItemBits( FN_DROP_REGION ) | ToolBoxItemBits::DROPDOWNONLY ); m_aContentToolBox->SetItemBits(nNavId, m_aContentToolBox->GetItemBits(nNavId) | ToolBoxItemBits::DROPDOWNONLY );
m_aContentToolBox->SetItemBits( FN_OUTLINE_LEVEL, m_aContentToolBox->GetItemBits( FN_OUTLINE_LEVEL ) | 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()) if(IsGlobalDoc())
{ {
SwView *pActView = GetCreateView(); SwView *pActView = GetCreateView();
m_aGlobalToolBox->CheckItem(FN_GLOBAL_SAVE_CONTENT, m_aGlobalToolBox->CheckItem(m_aGlobalToolBox->GetItemId("save"),
pActView->GetWrtShellPtr()->IsGlblDocSaveLinks()); pActView->GetWrtShellPtr()->IsGlblDocSaveLinks());
if(m_pConfig->IsGlobalActive()) if (m_pConfig->IsGlobalActive())
ToggleTree(); ToggleTree();
m_aGlobalTree->GrabFocus(); m_aGlobalTree->GrabFocus();
} }
@@ -836,8 +740,10 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
// displayed in the sidebar. While the navigator could change // displayed in the sidebar. While the navigator could change
// its size, the sidebar can not, and the navigator would just // its size, the sidebar can not, and the navigator would just
// waste space. Therefore hide this button. // 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() SwNavigationPI::~SwNavigationPI()
@@ -847,11 +753,11 @@ SwNavigationPI::~SwNavigationPI()
void SwNavigationPI::dispose() void SwNavigationPI::dispose()
{ {
if(IsGlobalDoc() && !IsGlobalMode()) if (IsGlobalDoc() && !IsGlobalMode())
{ {
SwView *pView = GetCreateView(); SwView *pView = GetCreateView();
SwWrtShell &rSh = pView->GetWrtShell(); SwWrtShell &rSh = pView->GetWrtShell();
if( !rSh.IsAllProtect() ) if (!rSh.IsAllProtect())
pView->GetDocShell()->SetReadOnlyUI(false); pView->GetDocShell()->SetReadOnlyUI(false);
} }
@@ -862,29 +768,32 @@ void SwNavigationPI::dispose()
pImgMan->ReleaseToolBox(m_aGlobalToolBox.get()); pImgMan->ReleaseToolBox(m_aGlobalToolBox.get());
m_aContentToolBox->GetItemWindow(FN_PAGENUMBER)->disposeOnce(); m_aContentToolBox->GetItemWindow(FN_PAGENUMBER)->disposeOnce();
m_aContentToolBox->Clear(); m_aContentToolBox->Clear();
if(m_pxObjectShell) if (m_pxObjectShell)
{ {
if(m_pxObjectShell->Is()) if (m_pxObjectShell->Is())
(*m_pxObjectShell)->DoClose(); (*m_pxObjectShell)->DoClose();
delete m_pxObjectShell; delete m_pxObjectShell;
} }
if ( IsBound() ) if (IsBound())
m_rBindings.Release(*this); m_rBindings.Release(*this);
m_pFloatingWindow.disposeAndClear(); m_pFloatingWindow.disposeAndClear();
m_pPopupWindow.disposeAndClear(); m_pPopupWindow.disposeAndClear();
m_aDocListBox.disposeAndClear(); m_aDocListBox.clear();
m_aGlobalTree.disposeAndClear(); m_aGlobalTree.disposeAndClear();
m_aGlobalBox.clear();
m_aContentTree.disposeAndClear(); m_aContentTree.disposeAndClear();
m_aContentBox.clear();
m_aGlobalToolBox.disposeAndClear(); m_aGlobalToolBox.disposeAndClear();
m_aContentToolBox.disposeAndClear(); m_xEdit.disposeAndClear();
m_aContentToolBox.clear();
m_aPageChgIdle.Stop(); m_aPageChgIdle.Stop();
::SfxControllerItem::dispose(); ::SfxControllerItem::dispose();
vcl::Window::dispose(); PanelLayout::dispose();
} }
void SwNavigationPI::SetPopupWindow( SfxPopupWindow* pWindow ) void SwNavigationPI::SetPopupWindow( SfxPopupWindow* pWindow )
@@ -931,15 +840,14 @@ void SwNavigationPI::StateChanged( sal_uInt16 nSID, SfxItemState /*eState*/,
SwWrtShell* pWrtShell = pActView->GetWrtShellPtr(); SwWrtShell* pWrtShell = pActView->GetWrtShellPtr();
m_aContentTree->SetActiveShell(pWrtShell); m_aContentTree->SetActiveShell(pWrtShell);
bool bGlobal = IsGlobalDoc(); bool bGlobal = IsGlobalDoc();
m_aContentToolBox->EnableItem(FN_GLOBAL_SWITCH, bGlobal); m_aContentToolBox->EnableItem(m_aContentToolBox->GetItemId("toggle"), bGlobal);
if( (!bGlobal && IsGlobalMode()) || if ((!bGlobal && IsGlobalMode()) || (!IsGlobalMode() && m_pConfig->IsGlobalActive()))
(!IsGlobalMode() && m_pConfig->IsGlobalActive()) )
{ {
ToggleTree(); ToggleTree();
} }
if(bGlobal) if (bGlobal)
{ {
m_aGlobalToolBox->CheckItem(FN_GLOBAL_SAVE_CONTENT, pWrtShell->IsGlblDocSaveLinks()); m_aGlobalToolBox->CheckItem(m_aGlobalToolBox->GetItemId("save"), pWrtShell->IsGlblDocSaveLinks());
} }
} }
else else
@@ -1195,28 +1103,34 @@ void SwNavigationPI::SetRegionDropMode(RegionMode nNewMode)
m_nRegionMode = nNewMode; m_nRegionMode = nNewMode;
m_pConfig->SetRegionMode( m_nRegionMode ); m_pConfig->SetRegionMode( m_nRegionMode );
sal_uInt16 nDropId = FN_DROP_REGION; sal_uInt16 nImageId = 0;
if(m_nRegionMode == RegionMode::LINK) switch (nNewMode)
nDropId = FN_DROP_REGION_LINK; {
else if(m_nRegionMode == RegionMode::EMBEDDED) case RegionMode::NONE:
nDropId = FN_DROP_REGION_COPY; nImageId = RID_IMG_DROP_REGION;
break;
ImageList& rImgLst = m_aContentImageList; case RegionMode::LINK:
nImageId = RID_IMG_DROP_LINK;
m_aContentToolBox->SetItemImage( FN_DROP_REGION, rImgLst.GetImage(nDropId)); 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(); bool bGlobalDoc = IsGlobalDoc();
if(!IsGlobalMode() && bGlobalDoc) if (!IsGlobalMode() && bGlobalDoc)
{ {
SetUpdateMode(false); SetUpdateMode(false);
if(IsZoomedIn()) if (IsZoomedIn())
ZoomOut(); ZoomOut();
m_aGlobalBox->Show();
m_aGlobalTree->ShowTree(); m_aGlobalTree->ShowTree();
m_aGlobalToolBox->Show(); m_aGlobalToolBox->Show();
m_aContentBox->Hide();
m_aContentTree->HideTree(); m_aContentTree->HideTree();
m_aContentToolBox->Hide(); m_aContentToolBox->Hide();
m_aDocListBox->Hide(); m_aDocListBox->Hide();
@@ -1225,25 +1139,25 @@ bool SwNavigationPI::ToggleTree()
} }
else else
{ {
m_aGlobalBox->Hide();
m_aGlobalTree->HideTree(); m_aGlobalTree->HideTree();
m_aGlobalToolBox->Hide(); m_aGlobalToolBox->Hide();
if(!IsZoomedIn()) if (!IsZoomedIn())
{ {
m_aContentBox->Show();
m_aContentTree->ShowTree(); m_aContentTree->ShowTree();
m_aContentToolBox->Show(); m_aContentToolBox->Show();
m_aDocListBox->Show(); m_aDocListBox->Show();
} }
bRet = false;
SetGlobalMode(false); SetGlobalMode(false);
} }
return bRet;
} }
bool SwNavigationPI::IsGlobalDoc() const bool SwNavigationPI::IsGlobalDoc() const
{ {
bool bRet = false; bool bRet = false;
SwView *pView = GetCreateView(); SwView *pView = GetCreateView();
if(pView) if (pView)
{ {
SwWrtShell &rSh = pView->GetWrtShell(); SwWrtShell &rSh = pView->GetWrtShell();
bRet = rSh.IsGlobalDoc(); bRet = rSh.IsGlobalDoc();
@@ -1262,17 +1176,17 @@ IMPL_LINK_NOARG(SwNavigationPI, ChangePageHdl, Idle *, void)
IMPL_LINK_NOARG(SwNavigationPI, PageEditModifyHdl, SpinField&, void) IMPL_LINK_NOARG(SwNavigationPI, PageEditModifyHdl, SpinField&, void)
{ {
if(m_aPageChgIdle.IsActive()) if (m_aPageChgIdle.IsActive())
m_aPageChgIdle.Stop(); m_aPageChgIdle.Stop();
m_aPageChgIdle.Start(); m_aPageChgIdle.Start();
} }
SwView* SwNavigationPI::GetCreateView() const SwView* SwNavigationPI::GetCreateView() const
{ {
if(!m_pCreateView) if (!m_pCreateView)
{ {
SwView* pView = SwModule::GetFirstView(); SwView* pView = SwModule::GetFirstView();
while(pView) while (pView)
{ {
if(&pView->GetViewFrame()->GetBindings() == &m_rBindings) if(&pView->GetViewFrame()->GetBindings() == &m_rBindings)
{ {
@@ -1293,7 +1207,6 @@ SwNavigationChild::SwNavigationChild( vcl::Window* pParent,
: SfxChildWindowContext( nId ) : SfxChildWindowContext( nId )
{ {
VclPtr<SwNavigationPI> pNavi = VclPtr<SwNavigationPI>::Create( _pBindings, this, pParent ); VclPtr<SwNavigationPI> pNavi = VclPtr<SwNavigationPI>::Create( _pBindings, this, pParent );
SetWindow( pNavi );
_pBindings->Invalidate(SID_NAVIGATOR); _pBindings->Invalidate(SID_NAVIGATOR);
SwNavigationConfig* pNaviConfig = SW_MOD()->GetNavigationConfig(); SwNavigationConfig* pNaviConfig = SW_MOD()->GetNavigationConfig();
@@ -1302,49 +1215,19 @@ SwNavigationChild::SwNavigationChild( vcl::Window* pParent,
if( nRootType != ContentTypeId::UNKNOWN ) if( nRootType != ContentTypeId::UNKNOWN )
{ {
pNavi->m_aContentTree->SetRootType(nRootType); 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->m_aContentTree->SetOutlineLevel( static_cast< sal_uInt8 >( pNaviConfig->GetOutlineLevel() ) );
pNavi->SetRegionDropMode( pNaviConfig->GetRegionMode() ); pNavi->SetRegionDropMode( pNaviConfig->GetRegionMode() );
if(GetFloatingWindow() && pNaviConfig->IsSmall()) if (SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(pParent))
{ {
pNav->SetMinOutputSizePixel(pNavi->GetOptimalSize());
if (pNaviConfig->IsSmall())
pNavi->ZoomIn(); pNavi->ZoomIn();
} }
}
void SwNavigationPI::DataChanged( const DataChangedEvent& rDCEvt ) SetWindow(pNavi);
{
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));
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -16,8 +16,6 @@
* except in compliance with the License. You may obtain a copy of * except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#define IL_CONTENT 7
#define TB_CONTENT 50
#define TL_CONTENT 51 #define TL_CONTENT 51
#define LB_DOCS 53 #define LB_DOCS 53
#define TL_GLOBAL 55 #define TL_GLOBAL 55

View File

@@ -24,276 +24,6 @@
#include "helpid.h" #include "helpid.h"
#include "access.hrc" #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 ImageList IMG_NAVI_ENTRYBMP
{ {
Prefix = "nc"; Prefix = "nc";
@@ -315,6 +45,30 @@ ImageList IMG_NAVI_ENTRYBMP
IdCount = { 12 ; }; 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 String STR_ACCESS_TL_GLOBAL
{ {
Text [ en-US ] = "Global View"; Text [ en-US ] = "Global View";

View File

@@ -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&lt;-&gt;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>