summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-09-02 18:26:21 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-09-02 21:57:28 +0100
commit5fa84a49fe66a18f48a8b6e40bd6f94e979cb8df (patch)
tree7b8d3bd1371db99f310d9e2c55df60bdc1070c52 /reportdesign
parenta704d910ffa6cad69c1ea1d0445ed9e9aac8604d (diff)
convert RID_NAVIGATOR floatingwindow to .ui
Change-Id: I40dbe9d315889a7c0033e940499b52aa4c137690
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/UIConfig_dbreport.mk1
-rw-r--r--reportdesign/inc/RptResId.hrc1
-rw-r--r--reportdesign/inc/helpids.hrc1
-rw-r--r--reportdesign/source/ui/dlg/Navigator.cxx57
-rw-r--r--reportdesign/source/ui/dlg/Navigator.src19
-rw-r--r--reportdesign/source/ui/inc/Navigator.hxx2
-rw-r--r--reportdesign/source/ui/report/DesignView.cxx4
-rw-r--r--reportdesign/uiconfig/dbreport/ui/floatingnavigator.ui25
8 files changed, 42 insertions, 68 deletions
diff --git a/reportdesign/UIConfig_dbreport.mk b/reportdesign/UIConfig_dbreport.mk
index ec44450bf4a5..95fc0fa6b625 100644
--- a/reportdesign/UIConfig_dbreport.mk
+++ b/reportdesign/UIConfig_dbreport.mk
@@ -40,6 +40,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/dbreport,\
reportdesign/uiconfig/dbreport/ui/condformatdialog \
reportdesign/uiconfig/dbreport/ui/conditionwin \
reportdesign/uiconfig/dbreport/ui/datetimedialog \
+ reportdesign/uiconfig/dbreport/ui/floatingnavigator \
reportdesign/uiconfig/dbreport/ui/pagedialog \
reportdesign/uiconfig/dbreport/ui/pagenumberdialog \
))
diff --git a/reportdesign/inc/RptResId.hrc b/reportdesign/inc/RptResId.hrc
index ccdcf35c6c97..c60e14ad2439 100644
--- a/reportdesign/inc/RptResId.hrc
+++ b/reportdesign/inc/RptResId.hrc
@@ -41,7 +41,6 @@
#define RID_GROUPS_SORTING ( RID_DIALOG_START + 0 )
#define RID_DATETIME_DLG ( RID_DIALOG_START + 2 )
#define WIN_CONDITION ( RID_DIALOG_START + 4 )
-#define RID_NAVIGATOR ( RID_DIALOG_START + 5 )
// strings
#define RID_STR_CLASS_FORMATTEDFIELD ( RID_STRING_START + 1 )
diff --git a/reportdesign/inc/helpids.hrc b/reportdesign/inc/helpids.hrc
index 3abc4289cf46..97534904b649 100644
--- a/reportdesign/inc/helpids.hrc
+++ b/reportdesign/inc/helpids.hrc
@@ -91,7 +91,6 @@
#define HID_RPT_START_IMAGE "REPORTDESIGN_HID_RPT_START_IMAGE"
#define HID_RPT_PROP_DEEPTRAVERSING "REPORTDESIGN_HID_RPT_PROP_DEEPTRAVERSING"
#define HID_RPT_PROP_PREEVALUATED "REPORTDESIGN_HID_RPT_PROP_PREEVALUATED"
-#define HID_RPT_NAVIGATOR_DLG "REPORTDESIGN_HID_RPT_NAVIGATOR_DLG"
#define HID_REPORT_NAVIGATOR_TREE "REPORTDESIGN_HID_REPORT_NAVIGATOR_TREE"
#define HID_RPT_PROP_FORMULA "REPORTDESIGN_HID_RPT_PROP_FORMULA"
#define HID_RPT_PROP_INITIALFORMULA "REPORTDESIGN_HID_RPT_PROP_INITIALFORMULA"
diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx
index f89a4459e92d..9b8864f79fc7 100644
--- a/reportdesign/source/ui/dlg/Navigator.cxx
+++ b/reportdesign/source/ui/dlg/Navigator.cxx
@@ -128,6 +128,7 @@ class NavigatorTree : public ::cppu::BaseMutex
inline uno::Reference< uno::XInterface > getContent() const { return m_xContent; }
inline void setContent(const uno::Reference< uno::XInterface >& _xContent) { m_xContent = _xContent; }
+
protected:
// OPropertyChangeListener
virtual void _propertyChanged(const beans::PropertyChangeEvent& _rEvent) throw( uno::RuntimeException) SAL_OVERRIDE;
@@ -205,6 +206,8 @@ public:
SvTreeListEntry* find(const uno::Reference< uno::XInterface >& _xContent);
void removeEntry(SvTreeListEntry* _pEntry,bool _bRemove = true);
+
+ virtual Size GetOptimalSize() const SAL_OVERRIDE;
private:
using SvTreeListBox::ExecuteDrop;
};
@@ -220,6 +223,9 @@ NavigatorTree::NavigatorTree( Window* pParent,OReportController& _rController )
,m_pDragedEntry(NULL)
,m_nTimerCounter( DROP_ACTION_TIMER_INITIAL_TICKS )
{
+ set_hexpand(true);
+ set_vexpand(true);
+
m_pReportListener = new OPropertyChangeMultiplexer(this,m_rController.getReportDefinition().get());
m_pReportListener->addProperty(PROPERTY_PAGEHEADERON);
m_pReportListener->addProperty(PROPERTY_PAGEFOOTERON);
@@ -861,13 +867,16 @@ void NavigatorTree::UserData::_disposing(const lang::EventObject& _rSource)
m_pTree->_disposing( _rSource );
}
-// class ONavigatorImpl
+Size NavigatorTree::GetOptimalSize() const
+{
+ return LogicToPixel(Size(100, 70), MAP_APPFONT);
+}
+// class ONavigatorImpl
class ONavigatorImpl: private boost::noncopyable
{
public:
ONavigatorImpl(OReportController& _rController,ONavigator* _pParent);
- virtual ~ONavigatorImpl();
uno::Reference< report::XReportDefinition> m_xReport;
::rptui::OReportController& m_rController;
@@ -877,7 +886,7 @@ public:
ONavigatorImpl::ONavigatorImpl(OReportController& _rController,ONavigator* _pParent)
:m_xReport(_rController.getReportDefinition())
,m_rController(_rController)
- ,m_pNavigatorTree(new NavigatorTree(_pParent,_rController))
+ ,m_pNavigatorTree(new NavigatorTree(_pParent->get<Window>("box"),_rController))
{
reportdesign::OReportVisitor aVisitor(m_pNavigatorTree.get());
aVisitor.start(m_xReport);
@@ -886,55 +895,17 @@ ONavigatorImpl::ONavigatorImpl(OReportController& _rController,ONavigator* _pPar
m_pNavigatorTree->_selectionChanged(aEvent);
}
-ONavigatorImpl::~ONavigatorImpl()
-{
-}
-
-const long STD_WIN_SIZE_X = 210;
-const long STD_WIN_SIZE_Y = 280;
-const long LISTBOX_BORDER = 2;
-
// class ONavigator
-
-ONavigator::ONavigator( Window* _pParent
- ,OReportController& _rController)
- : FloatingWindow( _pParent, ModuleRes(RID_NAVIGATOR) )
+ONavigator::ONavigator(Window* _pParent ,OReportController& _rController)
+ : FloatingWindow( _pParent, "FloatingNavigator", "modules/dbreport/ui/floatingnavigator.ui")
{
-
m_pImpl.reset(new ONavigatorImpl(_rController,this));
- FreeResource();
m_pImpl->m_pNavigatorTree->Show();
m_pImpl->m_pNavigatorTree->GrabFocus();
- SetSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y));
Show();
-
}
-
-
-ONavigator::~ONavigator()
-{
-}
-
-void ONavigator::Resize()
-{
- FloatingWindow::Resize();
-
- Size aSize( GetOutputSizePixel() );
-
-
-
- // Groesse der form::ListBox anpassen
- Point aLBPos( LISTBOX_BORDER, LISTBOX_BORDER );
- Size aLBSize( aSize );
- aLBSize.Width() -= (2*LISTBOX_BORDER);
- aLBSize.Height() -= (2*LISTBOX_BORDER);
-
- m_pImpl->m_pNavigatorTree->SetPosSizePixel( aLBPos, aLBSize );
-}
-
-
void ONavigator::GetFocus()
{
Window::GetFocus();
diff --git a/reportdesign/source/ui/dlg/Navigator.src b/reportdesign/source/ui/dlg/Navigator.src
index 242ee1a70984..c6471f67efd6 100644
--- a/reportdesign/source/ui/dlg/Navigator.src
+++ b/reportdesign/source/ui/dlg/Navigator.src
@@ -27,25 +27,6 @@
#define RID_SVXIMG_EXPANDEDNODE (RID_FORMS_START + 3)
#define RID_SVXIMG_FORMS (RID_FORMS_START +13)
-FloatingWindow RID_NAVIGATOR
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 200 , 250 ) ;
- Text [ en-US ] = "Report navigator" ;
- HelpId = HID_RPT_NAVIGATOR_DLG;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Sizeable = TRUE;
-
- Control 1
- {
- Pos = MAP_APPFONT( 0, 0 );
- Size = MAP_APPFONT( 200, 250 );
- Border = TRUE;
- TabStop = TRUE;
- };
-};
#define NAVIGATOR_IMAGEIDS \
IdList = \
{ \
diff --git a/reportdesign/source/ui/inc/Navigator.hxx b/reportdesign/source/ui/inc/Navigator.hxx
index 42b5fa016cb5..9f7942aa3bad 100644
--- a/reportdesign/source/ui/inc/Navigator.hxx
+++ b/reportdesign/source/ui/inc/Navigator.hxx
@@ -35,10 +35,8 @@ namespace rptui
public:
ONavigator( Window* pParent
,OReportController& _rController);
- virtual ~ONavigator();
// window
- virtual void Resize() SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
};
diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx
index b4e9de932b96..2558c8cc0c99 100644
--- a/reportdesign/source/ui/report/DesignView.cxx
+++ b/reportdesign/source/ui/report/DesignView.cxx
@@ -149,7 +149,7 @@ ODesignView::~ODesignView()
}
if ( m_pReportExplorer )
{
- SvtViewOptions aDlgOpt( E_WINDOW, OUString::number( RID_NAVIGATOR) );
+ SvtViewOptions aDlgOpt(E_WINDOW, OStringToOUString(m_pReportExplorer->GetHelpId(), RTL_TEXTENCODING_UTF8));
aDlgOpt.SetWindowState(OStringToOUString(m_pReportExplorer->GetWindowState(WINDOWSTATE_MASK_ALL), RTL_TEXTENCODING_ASCII_US));
notifySystemWindow(this,m_pReportExplorer,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
SAL_WNODEPRECATED_DECLARATIONS_PUSH
@@ -496,7 +496,7 @@ void ODesignView::toggleReportExplorer()
{
OReportController& rReportController = getController();
m_pReportExplorer = new ONavigator(this,rReportController);
- SvtViewOptions aDlgOpt( E_WINDOW, OUString::number( RID_NAVIGATOR) );
+ SvtViewOptions aDlgOpt(E_WINDOW, OStringToOUString(m_pReportExplorer->GetHelpId(), RTL_TEXTENCODING_UTF8));
if ( aDlgOpt.Exists() )
m_pReportExplorer->SetWindowState(OUStringToOString(aDlgOpt.GetWindowState(), RTL_TEXTENCODING_ASCII_US));
m_pReportExplorer->AddEventListener(LINK(&rReportController,OReportController,EventLstHdl));
diff --git a/reportdesign/uiconfig/dbreport/ui/floatingnavigator.ui b/reportdesign/uiconfig/dbreport/ui/floatingnavigator.ui
new file mode 100644
index 000000000000..e4d3ef8d8107
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/ui/floatingnavigator.ui
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkWindow" id="FloatingNavigator">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Report navigator</property>
+ <property name="type_hint">utility</property>
+ <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>
+ </child>
+ </object>
+</interface>