diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-09-04 16:54:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-09-05 12:21:57 +0100 |
commit | 5fc238d11e939064a70573ef93939af49a241b20 (patch) | |
tree | 5603a87025503c5444b713c2d801598cb677dd29 /sw/source/uibase | |
parent | 67034cb6689645cf8eed497444ea4b1ba7ca3848 (diff) |
convert RID_SCROLL_NAVIGATION_WIN floating window to .ui
Change-Id: I92d13856fc4d206323d5517a8a48671bba683fec
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/inc/ribbar.hrc | 35 | ||||
-rw-r--r-- | sw/source/uibase/inc/workctrl.hxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/ribbar/workctrl.cxx | 62 | ||||
-rw-r--r-- | sw/source/uibase/ribbar/workctrl.hrc | 23 | ||||
-rw-r--r-- | sw/source/uibase/ribbar/workctrl.src | 173 |
5 files changed, 129 insertions, 171 deletions
diff --git a/sw/source/uibase/inc/ribbar.hrc b/sw/source/uibase/inc/ribbar.hrc index 7070d24d519a..ac38d3155a9e 100644 --- a/sw/source/uibase/inc/ribbar.hrc +++ b/sw/source/uibase/inc/ribbar.hrc @@ -23,20 +23,37 @@ #define RID_TBX_FORMULA (RC_RIBBAR_BEGIN +6) #define FT_POS (RC_RIBBAR_BEGIN +7) -#define STR_TBL_FORMULA (RC_RIBBAR_BEGIN +9) +#define STR_TBL_FORMULA (RC_RIBBAR_BEGIN +8) -#define RID_DRAW_WIN (RC_RIBBAR_BEGIN + 18) -#define RID_CNTRLR_WIN (RC_RIBBAR_BEGIN + 19) -#define RID_ALIGNMENT_WIN (RC_RIBBAR_BEGIN + 20) +#define RID_DRAW_WIN (RC_RIBBAR_BEGIN + 9) +#define RID_CNTRLR_WIN (RC_RIBBAR_BEGIN + 10) +#define RID_ALIGNMENT_WIN (RC_RIBBAR_BEGIN + 11) //Resourcen fuer Inputwin (Rechenleiste) -#define MN_CALC_POPUP (RC_RIBBAR_BEGIN + 22) +#define MN_CALC_POPUP (RC_RIBBAR_BEGIN + 12) -#define RID_INSERT_FIELD_CTRL (RC_RIBBAR_BEGIN + 26) -#define RID_SCROLL_NAVIGATION_WIN (RC_RIBBAR_BEGIN + 30) -#define RID_PVIEW_ZOOM_LB (RC_RIBBAR_BEGIN + 31) +#define RID_INSERT_FIELD_CTRL (RC_RIBBAR_BEGIN + 13) +#define ST_TBL (RC_RIBBAR_BEGIN + 14) +#define ST_FRM (RC_RIBBAR_BEGIN + 15) +#define ST_PGE (RC_RIBBAR_BEGIN + 16) +#define ST_DRW (RC_RIBBAR_BEGIN + 17) +#define ST_CTRL (RC_RIBBAR_BEGIN + 18) +#define ST_REG (RC_RIBBAR_BEGIN + 19) +#define ST_BKM (RC_RIBBAR_BEGIN + 20) +#define ST_GRF (RC_RIBBAR_BEGIN + 21) +#define ST_OLE (RC_RIBBAR_BEGIN + 22) +#define ST_OUTL (RC_RIBBAR_BEGIN + 23) +#define ST_SEL (RC_RIBBAR_BEGIN + 24) +#define ST_FTN (RC_RIBBAR_BEGIN + 25) +#define ST_MARK (RC_RIBBAR_BEGIN + 26) +#define ST_POSTIT (RC_RIBBAR_BEGIN + 27) +#define ST_SRCH_REP (RC_RIBBAR_BEGIN + 28) +#define ST_INDEX_ENTRY (RC_RIBBAR_BEGIN + 29) +#define ST_TABLE_FORMULA (RC_RIBBAR_BEGIN + 30) +#define ST_TABLE_FORMULA_ERROR (RC_RIBBAR_BEGIN + 31) +#define RID_PVIEW_ZOOM_LB (RC_RIBBAR_BEGIN + 32) -#define STR_IMGBTN_START (RC_RIBBAR_BEGIN + 31) +#define STR_IMGBTN_START (RC_RIBBAR_BEGIN + 33) #define STR_IMGBTN_NEXT_DOWN (STR_IMGBTN_START + 0) #define STR_IMGBTN_PREV_DOWN (STR_IMGBTN_START + 1) diff --git a/sw/source/uibase/inc/workctrl.hxx b/sw/source/uibase/inc/workctrl.hxx index 23ef121bfad5..b76334db52f7 100644 --- a/sw/source/uibase/inc/workctrl.hxx +++ b/sw/source/uibase/inc/workctrl.hxx @@ -127,9 +127,8 @@ class SwScrollNaviToolBox : public ToolBox class SwScrollNaviPopup : public SfxPopupWindow { - SwScrollNaviToolBox aToolBox; - FixedLine aSeparator; - FixedInfo aInfoField; + SwScrollNaviToolBox* m_pToolBox; + FixedText* m_pInfoField; ImageList aIList; OUString sQuickHelp[2 * NID_COUNT]; @@ -149,7 +148,7 @@ public: static OUString GetQuickHelpText(bool bNext); virtual SfxPopupWindow* Clone() const SAL_OVERRIDE; - void GrabFocus(){aToolBox.GrabFocus();} + void GrabFocus() { m_pToolBox->GrabFocus(); } }; // ImageButtons have to set the HelpText themselves if needed diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index afaad13a1d75..48a4a789b352 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -451,17 +451,18 @@ static const char* aNavigationHelpIds[ NAVI_ENTRIES ] = }; SwScrollNaviPopup::SwScrollNaviPopup(sal_uInt16 nId, const Reference< XFrame >& rFrame, Window *pParent) - : SfxPopupWindow(nId, rFrame, pParent, SW_RES(RID_SCROLL_NAVIGATION_WIN)), - aToolBox(this, 0), - aSeparator(this, SW_RES(FL_SEP)), - aInfoField(this, SW_RES(FI_INFO)), + : SfxPopupWindow(nId, pParent, "FloatingNavigation", + "modules/swriter/ui/floatingnavigation.ui", rFrame), aIList(SW_RES(IL_VALUES)) { + m_pToolBox = new SwScrollNaviToolBox(get<Window>("box"), 0); + get(m_pInfoField, "label"); + sal_uInt16 i; - aToolBox.SetHelpId(HID_NAVI_VS); - aToolBox.SetLineCount( 2 ); - aToolBox.SetOutStyle(TOOLBOX_STYLE_FLAT); + m_pToolBox->SetHelpId(HID_NAVI_VS); + m_pToolBox->SetLineCount( 2 ); + m_pToolBox->SetOutStyle(TOOLBOX_STYLE_FLAT); for( i = 0; i < NID_COUNT; i++) { sal_uInt16 nNaviId = aNavigationInsertIds[i]; @@ -481,13 +482,11 @@ SwScrollNaviPopup::SwScrollNaviPopup(sal_uInt16 nId, const Reference< XFrame >& else if (nNaviId == NID_NEXT) sText = SW_RESSTR(STR_IMGBTN_PGE_DOWN); } - aToolBox.InsertItem(nNaviId, sText, nTbxBits); - aToolBox.SetHelpId( nNaviId, aNavigationHelpIds[i] ); + m_pToolBox->InsertItem(nNaviId, sText, nTbxBits); + m_pToolBox->SetHelpId( nNaviId, aNavigationHelpIds[i] ); } ApplyImageList(); - aToolBox.InsertBreak(NID_COUNT/2); - // don't call it before! - FreeResource(); + m_pToolBox->InsertBreak(NID_COUNT/2); // these are global strings for( i = 0; i < 2 * NID_COUNT; i++) @@ -495,33 +494,18 @@ SwScrollNaviPopup::SwScrollNaviPopup(sal_uInt16 nId, const Reference< XFrame >& sQuickHelp[i] = SW_RESSTR(STR_IMGBTN_START + i); } - Size aImgSize = aIList.GetImageSize(); - aImgSize.Width() += 5; - aImgSize.Height() += 5; - Size aSz = aToolBox.CalcWindowSizePixel(2); - aToolBox.SetPosSizePixel( Point(), aSz ); sal_uInt16 nItemId = SwView::GetMoveType(); - aInfoField.SetText(aToolBox.GetItemText(nItemId)); - aToolBox.CheckItem( nItemId, true ); - Size aFTSize(aInfoField.GetSizePixel()); - Size aSepSize(aSeparator.GetSizePixel()); - aSepSize.Width() = aSz.Width(); - - aSz.Height() += aFTSize.Height() + aSepSize.Height(); - aInfoField.SetPosSizePixel( - Point(0, aSz.Height() - aFTSize.Height()), Size(aSz.Width(), aFTSize.Height())); - - aSeparator.SetSizePixel(aSepSize); - aSeparator.SetPosPixel(Point(0, aSz.Height() - aFTSize.Height() - aSepSize.Height())); + m_pInfoField->SetText(m_pToolBox->GetItemText(nItemId)); + m_pToolBox->CheckItem( nItemId, true ); - SetOutputSizePixel(aSz); - aToolBox.SetSelectHdl(LINK(this, SwScrollNaviPopup, SelectHdl)); - aToolBox.StartSelection(); - aToolBox.Show(); + m_pToolBox->SetSelectHdl(LINK(this, SwScrollNaviPopup, SelectHdl)); + m_pToolBox->StartSelection(); + m_pToolBox->Show(); } SwScrollNaviPopup::~SwScrollNaviPopup() { + delete m_pToolBox; } void SwScrollNaviPopup::DataChanged( const DataChangedEvent& rDCEvt ) @@ -539,7 +523,7 @@ void SwScrollNaviPopup::ApplyImageList() for(sal_uInt16 i = 0; i < NID_COUNT; i++) { sal_uInt16 nNaviId = aNavigationInsertIds[i]; - aToolBox.SetItemImage(nNaviId, rImgLst.GetImage(nNaviId)); + m_pToolBox->SetItemImage(nNaviId, rImgLst.GetImage(nNaviId)); } } @@ -554,14 +538,14 @@ IMPL_LINK(SwScrollNaviPopup, SelectHdl, ToolBox*, pSet) if( nSet != NID_PREV && nSet != NID_NEXT ) { SwView::SetMoveType(nSet); - aToolBox.SetItemText(NID_NEXT, sQuickHelp[nSet - NID_START]); - aToolBox.SetItemText(NID_PREV, sQuickHelp[nSet - NID_START + NID_COUNT]); - aInfoField.SetText(aToolBox.GetItemText(nSet)); + m_pToolBox->SetItemText(NID_NEXT, sQuickHelp[nSet - NID_START]); + m_pToolBox->SetItemText(NID_PREV, sQuickHelp[nSet - NID_START + NID_COUNT]); + m_pInfoField->SetText(m_pToolBox->GetItemText(nSet)); // check the current button only for(sal_uInt16 i = 0; i < NID_COUNT; i++) { - sal_uInt16 nItemId = aToolBox.GetItemId( i ); - aToolBox.CheckItem( nItemId, nItemId == nSet ); + sal_uInt16 nItemId = m_pToolBox->GetItemId( i ); + m_pToolBox->CheckItem( nItemId, nItemId == nSet ); } } else diff --git a/sw/source/uibase/ribbar/workctrl.hrc b/sw/source/uibase/ribbar/workctrl.hrc index 07c109548e43..056cb093be6b 100644 --- a/sw/source/uibase/ribbar/workctrl.hrc +++ b/sw/source/uibase/ribbar/workctrl.hrc @@ -20,29 +20,6 @@ #define _WORKCTRL_HRC #include "ribbar.hrc" -#define IL_VALUES 5 -#define FI_INFO 8 -#define FL_SEP 9 - -#define ST_TBL 12 -#define ST_FRM 13 -#define ST_PGE 14 -#define ST_DRW 15 -#define ST_CTRL 16 -#define ST_REG 17 -#define ST_BKM 18 -#define ST_GRF 19 -#define ST_OLE 20 -#define ST_OUTL 21 -#define ST_SEL 22 -#define ST_FTN 23 -#define ST_MARK 24 -#define ST_POSTIT 25 -#define ST_SRCH_REP 26 -#define ST_INDEX_ENTRY 27 -#define ST_TABLE_FORMULA 28 -#define ST_TABLE_FORMULA_ERROR 29 - // duplicate entry! hrc and hxx // these Ids specifiy the action of the buttons below the scroll bar #define NID_START 20000 diff --git a/sw/source/uibase/ribbar/workctrl.src b/sw/source/uibase/ribbar/workctrl.src index f3592d0a7a8e..0362623fc8aa 100644 --- a/sw/source/uibase/ribbar/workctrl.src +++ b/sw/source/uibase/ribbar/workctrl.src @@ -19,6 +19,7 @@ #include <svx/svxids.hrc> #include <svx/globlmn.hrc> +#include "globals.hrc" #include "workctrl.hrc" #include "helpid.h" #include "cmdid.h" @@ -107,103 +108,83 @@ Menu RID_INSERT_FIELD_CTRL }; \ IdCount = { 20 ; }; -FloatingWindow RID_SCROLL_NAVIGATION_WIN +ImageList IL_VALUES { - Moveable = TRUE ; - Closeable = TRUE ; - Hide = TRUE ; - SVLook = TRUE ; - HelpID = HID_INSERT_CTRL ; - ImageList IL_VALUES - { - Prefix = "sr"; - MaskColor = IMAGE_MASK_COLOR ; - SCROLL_IMAGE_IDLIST - }; - FixedLine FL_SEP - { - //no position, no text - Size = MAP_APPFONT ( 20 , 4 ) ; - }; - FixedText FI_INFO - { - //no position, no text - Size = MAP_APPFONT ( 20 , 8 ) ; - Center = TRUE; - }; - String ST_TBL - { - Text [ en-US ] = "Table" ; - }; - String ST_FRM - { - Text [ en-US ] = "Text Frame" ; - }; - String ST_PGE - { - Text [ en-US ] = "Page" ; - }; - String ST_DRW - { - Text [ en-US ] = "Drawing" ; - }; - String ST_CTRL - { - Text [ en-US ] = "Control" ; - }; - String ST_REG - { - Text [ en-US ] = "Section" ; - }; - String ST_BKM - { - Text [ en-US ] = "Bookmark" ; - }; - String ST_GRF - { - Text [ en-US ] = "Graphics" ; - }; - String ST_OLE - { - Text [ en-US ] = "OLE object" ; - }; - String ST_OUTL - { - Text [ en-US ] = "Headings" ; - }; - String ST_SEL - { - Text [ en-US ] = "Selection" ; - }; - String ST_FTN - { - Text [ en-US ] = "Footnote" ; - }; - String ST_MARK - { - Text [ en-US ] = "Reminder" ; - }; - String ST_POSTIT - { - Text [ en-US ] = "Comment" ; - }; - String ST_SRCH_REP - { - Text [ en-US ] = "Repeat search" ; - }; - String ST_INDEX_ENTRY - { - Text [ en-US ] = "Index entry"; - }; - String ST_TABLE_FORMULA - { - Text [ en-US ] = "Table formula"; - }; - String ST_TABLE_FORMULA_ERROR - { - Text [ en-US ] = "Wrong table formula"; - }; - Text [ en-US ] = "Navigation" ; + Prefix = "sr"; + MaskColor = IMAGE_MASK_COLOR ; + SCROLL_IMAGE_IDLIST +}; +String ST_TBL +{ + Text [ en-US ] = "Table" ; +}; +String ST_FRM +{ + Text [ en-US ] = "Text Frame" ; +}; +String ST_PGE +{ + Text [ en-US ] = "Page" ; +}; +String ST_DRW +{ + Text [ en-US ] = "Drawing" ; +}; +String ST_CTRL +{ + Text [ en-US ] = "Control" ; +}; +String ST_REG +{ + Text [ en-US ] = "Section" ; +}; +String ST_BKM +{ + Text [ en-US ] = "Bookmark" ; +}; +String ST_GRF +{ + Text [ en-US ] = "Graphics" ; +}; +String ST_OLE +{ + Text [ en-US ] = "OLE object" ; +}; +String ST_OUTL +{ + Text [ en-US ] = "Headings" ; +}; +String ST_SEL +{ + Text [ en-US ] = "Selection" ; +}; +String ST_FTN +{ + Text [ en-US ] = "Footnote" ; +}; +String ST_MARK +{ + Text [ en-US ] = "Reminder" ; +}; +String ST_POSTIT +{ + Text [ en-US ] = "Comment" ; +}; +String ST_SRCH_REP +{ + Text [ en-US ] = "Repeat search" ; +}; +String ST_INDEX_ENTRY +{ + Text [ en-US ] = "Index entry"; +}; +String ST_TABLE_FORMULA +{ + Text [ en-US ] = "Table formula"; +}; +String ST_TABLE_FORMULA_ERROR +{ + Text [ en-US ] = "Wrong table formula"; }; // Strings for the quickhelp of the View-PgUp/Down-Buttons |