Kaydet (Commit) 5fc238d1 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert RID_SCROLL_NAVIGATION_WIN floating window to .ui

Change-Id: I92d13856fc4d206323d5517a8a48671bba683fec
üst 67034cb6
......@@ -142,6 +142,10 @@ public:
const OString& rID, const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame> &rFrame =
css::uno::Reference<css::frame::XFrame>());
SfxPopupWindow(sal_uInt16 nId, Window *pParent,
const OString& rID, const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame> &rFrame =
css::uno::Reference<css::frame::XFrame>());
SfxPopupWindow( sal_uInt16 nId,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
Window* pParentWindow,
......
......@@ -1189,6 +1189,23 @@ SfxPopupWindow::SfxPopupWindow(
((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( this );
}
SfxPopupWindow::SfxPopupWindow(
sal_uInt16 nId,
Window* pParentWindow,
const OString& rID, const OUString& rUIXMLDescription,
const Reference< XFrame >& rFrame ) :
FloatingWindow( pParentWindow, rID, rUIXMLDescription)
, m_bFloating( false )
, m_bCascading( false )
, m_nId( nId )
, m_xFrame( rFrame )
, m_pStatusListener( 0 )
{
Window* pWindow = GetTopMostParentSystemWindow( this );
if ( pWindow )
((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( this );
}
SfxPopupWindow::~SfxPopupWindow()
{
if ( m_xStatusListener.is() )
......
......@@ -113,6 +113,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/fldrefpage \
sw/uiconfig/swriter/ui/fldvarpage \
sw/uiconfig/swriter/ui/floatingmmchild \
sw/uiconfig/swriter/ui/floatingnavigation \
sw/uiconfig/swriter/ui/floatingsync \
sw/uiconfig/swriter/ui/formatsectiondialog \
sw/uiconfig/swriter/ui/formattablepage \
......
......@@ -81,11 +81,12 @@
#define STR_READONLY_PATH (RC_GLOBALS_BEGIN + 47)
#define IL_SECTION_BITMAPS (RC_GLOBALS_BEGIN + 48)
#define IL_VALUES (RC_GLOBALS_BEGIN + 49)
// INFOBOX ------------------------------------------------------------
#define STR_ERROR_CLPBRD_READ (RC_GLOBALS_BEGIN + 49)
#define STR_ERROR_PASSWD (RC_GLOBALS_BEGIN + 50)
#define STR_ERROR_CLPBRD_READ (RC_GLOBALS_BEGIN + 50)
#define STR_ERROR_PASSWD (RC_GLOBALS_BEGIN + 51)
// ACC ---------------------------------------------------------------
......
......@@ -33,7 +33,6 @@
#define HID_EDIT_WIN "SW_HID_EDIT_WIN"
#define HID_INSERT_CTRL "SW_HID_INSERT_CTRL" // TbxControl Einfuegen
#define HID_INSERT_FIELD_CTRL "SW_HID_INSERT_FIELD_CTRL"
#define HID_SOURCEVIEW "SW_HID_SOURCEVIEW"
......
......@@ -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)
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.16.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkWindow" id="FloatingNavigation">
<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="title" translatable="yes">Navigation</property>
<property name="resizable">False</property>
<property name="type_hint">utility</property>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="row_spacing">12</property>
<child>
<object class="GtkLabel" id="label">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box">
<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">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
</child>
</object>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment