summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/appl/app.hrc1
-rw-r--r--sfx2/source/appl/newhelp.cxx108
-rw-r--r--sfx2/source/appl/newhelp.hxx14
-rw-r--r--sfx2/source/appl/newhelp.src29
-rw-r--r--sfx2/source/inc/helpid.hrc1
5 files changed, 45 insertions, 108 deletions
diff --git a/sfx2/source/appl/app.hrc b/sfx2/source/appl/app.hrc
index 84050c0b832a..e6c1adca233d 100644
--- a/sfx2/source/appl/app.hrc
+++ b/sfx2/source/appl/app.hrc
@@ -45,7 +45,6 @@
#define TP_HELP_CONTENT (RID_SFX_APP_START+100)
#define TP_HELP_INDEX (RID_SFX_APP_START+101)
#define TP_HELP_SEARCH (RID_SFX_APP_START+102)
-#define TP_HELP_BOOKMARKS (RID_SFX_APP_START+103)
#define MENU_HELP_BOOKMARKS (RID_SFX_APP_START+105)
#define RID_INFO_NOSEARCHRESULTS (RID_SFX_APP_START+106)
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 664302cbcdbc..0b1f653d1d26 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -92,6 +92,7 @@
#include <svtools/imagemgr.hxx>
#include <svtools/miscopt.hxx>
#include <svtools/imgdef.hxx>
+#include <vcl/builder.hxx>
#include <vcl/unohelp.hxx>
#include <vcl/i18nhelp.hxx>
#include <vcl/settings.hxx>
@@ -414,13 +415,17 @@ OUString ContentListBox_Impl::GetSelectEntry() const
// class HelpTabPage_Impl ------------------------------------------------
-HelpTabPage_Impl::HelpTabPage_Impl(
- Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin, const ResId& rResId ) :
-
- TabPage( pParent, rResId ),
-
- m_pIdxWin( _pIdxWin )
+HelpTabPage_Impl::HelpTabPage_Impl(Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin,
+ const ResId& rResId )
+ : TabPage( pParent, rResId )
+ , m_pIdxWin( _pIdxWin )
+{
+}
+HelpTabPage_Impl::HelpTabPage_Impl(Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin,
+ const OString& rID, const OUString& rUIXMLDescription)
+ : TabPage( pParent, rID, rUIXMLDescription)
+ , m_pIdxWin( _pIdxWin )
{
}
@@ -1229,16 +1234,22 @@ void GetBookmarkEntry_Impl
}
}
-
-
-BookmarksBox_Impl::BookmarksBox_Impl( Window* pParent, const ResId& rResId ) :
-
- ListBox( pParent, rResId )
-
+BookmarksBox_Impl::BookmarksBox_Impl(Window* pParent, WinBits nStyle)
+ : ListBox(pParent, nStyle)
{
}
-
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeBookmarksBox(Window *pParent,
+ VclBuilder::stringmap &rMap)
+{
+ WinBits nWinBits = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE;
+ OString sBorder = VclBuilder::extractCustomProperty(rMap);
+ if (!sBorder.isEmpty())
+ nWinBits |= WB_BORDER;
+ BookmarksBox_Impl* pListBox = new BookmarksBox_Impl(pParent, nWinBits);
+ pListBox->EnableAutoSize(true);
+ return pListBox;
+}
BookmarksBox_Impl::~BookmarksBox_Impl()
{
@@ -1345,20 +1356,17 @@ bool BookmarksBox_Impl::Notify( NotifyEvent& rNEvt )
// class BookmarksTabPage_Impl -------------------------------------------
-BookmarksTabPage_Impl::BookmarksTabPage_Impl( Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin ) :
-
- HelpTabPage_Impl( pParent, _pIdxWin, SfxResId( TP_HELP_BOOKMARKS ) ),
-
- aBookmarksFT ( this, SfxResId( FT_BOOKMARKS ) ),
- aBookmarksBox ( this, SfxResId( LB_BOOKMARKS ) ),
- aBookmarksPB ( this, SfxResId( PB_BOOKMARKS ) )
-
+BookmarksTabPage_Impl::BookmarksTabPage_Impl(Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin)
+ : HelpTabPage_Impl(pParent, _pIdxWin, "HelpBookmarkPage",
+ "sfx/ui/helpbookmarkpage.ui")
{
- FreeResource();
-
- nMinWidth = aBookmarksPB.GetSizePixel().Width();
+ get(m_pBookmarksPB, "display");
+ get(m_pBookmarksBox, "bookmarks");
+ Size aSize(LogicToPixel(Size(120 , 200), MAP_APPFONT));
+ m_pBookmarksBox->set_width_request(aSize.Width());
+ m_pBookmarksBox->set_height_request(aSize.Height());
- aBookmarksPB.SetClickHdl( LINK( this, BookmarksTabPage_Impl, OpenHdl ) );
+ m_pBookmarksPB->SetClickHdl( LINK( this, BookmarksTabPage_Impl, OpenHdl ) );
// load bookmarks from configuration
Sequence< Sequence< PropertyValue > > aBookmarkSeq;
@@ -1379,68 +1387,30 @@ BookmarksTabPage_Impl::BookmarksTabPage_Impl( Window* pParent, SfxHelpIndexWindo
IMPL_LINK_NOARG(BookmarksTabPage_Impl, OpenHdl)
{
- aBookmarksBox.GetDoubleClickHdl().Call( &aBookmarksBox );
+ m_pBookmarksBox->GetDoubleClickHdl().Call(m_pBookmarksBox);
return 0;
}
-
-
-void BookmarksTabPage_Impl::Resize()
-{
- Size aSize = GetSizePixel();
- if ( aSize.Width() < nMinWidth )
- aSize.Width() = nMinWidth;
- Point aPnt = aBookmarksFT.GetPosPixel();
- Size aNewSize = aBookmarksFT.GetSizePixel();
- aNewSize.Width() = aSize.Width() - ( aPnt.X() * 2 );
- aBookmarksFT.SetSizePixel( aNewSize );
-
- Size a6Size = LogicToPixel( Size( 6, 6 ), MAP_APPFONT );
- Size aBtnSize = aBookmarksPB.GetSizePixel();
-
- aPnt = aBookmarksBox.GetPosPixel();
- aNewSize = aBookmarksBox.GetSizePixel();
- aNewSize.Width() = aSize.Width() - ( aPnt.X() * 2 );
- aNewSize.Height() = aSize.Height() - aPnt.Y();
- aNewSize.Height() -= ( aBtnSize.Height() + ( a6Size.Height() * 3 / 2 ) );
- aBookmarksBox.SetSizePixel( aNewSize );
-
- aPnt.X() += ( aNewSize.Width() - aBtnSize.Width() );
- aPnt.Y() += aNewSize.Height() + ( a6Size.Height() / 2 );
- long nMinX = aBookmarksBox.GetPosPixel().X();
- if ( aPnt.X() < nMinX )
- aPnt.X() = nMinX;
- aBookmarksPB.SetPosPixel( aPnt );
-}
-
-
-
void BookmarksTabPage_Impl::ActivatePage()
{
if ( !m_pIdxWin->WasCursorLeftOrRight() )
SetFocusOnBox();
}
-
-
Control* BookmarksTabPage_Impl::GetLastFocusControl()
{
- return &aBookmarksPB;
+ return m_pBookmarksPB;
}
-
-
void BookmarksTabPage_Impl::SetDoubleClickHdl( const Link& rLink )
{
- aBookmarksBox.SetDoubleClickHdl( rLink );
+ m_pBookmarksBox->SetDoubleClickHdl(rLink);
}
-
-
OUString BookmarksTabPage_Impl::GetSelectEntry() const
{
OUString aRet;
- OUString* pData = (OUString*)(sal_uIntPtr)aBookmarksBox.GetEntryData( aBookmarksBox.GetSelectEntryPos() );
+ OUString* pData = (OUString*)(sal_uIntPtr)m_pBookmarksBox->GetEntryData(m_pBookmarksBox->GetSelectEntryPos());
if ( pData )
aRet = *pData;
return aRet;
@@ -1452,8 +1422,8 @@ void BookmarksTabPage_Impl::AddBookmarks( const OUString& rTitle, const OUString
{
OUString aImageURL = IMAGE_URL;
aImageURL += INetURLObject( rURL ).GetHost();
- sal_uInt16 nPos = aBookmarksBox.InsertEntry( rTitle, SvFileInformationManager::GetImage( INetURLObject(aImageURL), false ) );
- aBookmarksBox.SetEntryData( nPos, new OUString( rURL ) );
+ sal_uInt16 nPos = m_pBookmarksBox->InsertEntry( rTitle, SvFileInformationManager::GetImage( INetURLObject(aImageURL), false ) );
+ m_pBookmarksBox->SetEntryData( nPos, new OUString( rURL ) );
}
OUString SfxHelpWindow_Impl::buildHelpURL(const OUString& sFactory ,
diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx
index 07866549247f..0feff967a084 100644
--- a/sfx2/source/appl/newhelp.hxx
+++ b/sfx2/source/appl/newhelp.hxx
@@ -79,6 +79,8 @@ protected:
public:
HelpTabPage_Impl( Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin, const ResId& rResId );
+ HelpTabPage_Impl(Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin,
+ const OString& rID, const OUString& rUIXMLDescription);
virtual Control* GetLastFocusControl() = 0;
};
@@ -238,7 +240,7 @@ private:
void DoAction( sal_uInt16 nAction );
public:
- BookmarksBox_Impl( Window* pParent, const ResId& rResId );
+ BookmarksBox_Impl(Window* pParent, WinBits nStyle);
~BookmarksBox_Impl();
virtual bool Notify( NotifyEvent& rNEvt );
@@ -247,25 +249,21 @@ public:
class BookmarksTabPage_Impl : public HelpTabPage_Impl
{
private:
- FixedText aBookmarksFT;
- BookmarksBox_Impl aBookmarksBox;
- PushButton aBookmarksPB;
-
- long nMinWidth;
+ BookmarksBox_Impl* m_pBookmarksBox;
+ PushButton* m_pBookmarksPB;
DECL_LINK(OpenHdl, void *);
public:
BookmarksTabPage_Impl( Window* pParent, SfxHelpIndexWindow_Impl* _pIdxWin );
- virtual void Resize();
virtual void ActivatePage();
virtual Control* GetLastFocusControl();
void SetDoubleClickHdl( const Link& rLink );
OUString GetSelectEntry() const;
void AddBookmarks( const OUString& rTitle, const OUString& rURL );
- inline void SetFocusOnBox() { aBookmarksBox.GrabFocus(); }
+ void SetFocusOnBox() { m_pBookmarksBox->GrabFocus(); }
};
// class SfxHelpIndexWindow_Impl -----------------------------------------
diff --git a/sfx2/source/appl/newhelp.src b/sfx2/source/appl/newhelp.src
index 9433d06ca02f..33058f38d0bc 100644
--- a/sfx2/source/appl/newhelp.src
+++ b/sfx2/source/appl/newhelp.src
@@ -156,35 +156,6 @@ TabPage TP_HELP_SEARCH
};
};
-TabPage TP_HELP_BOOKMARKS
-{
- HelpId = HID_HELP_TABPAGE_BOOKMARKS;
- Hide = TRUE ;
- DialogControl = TRUE;
- Size = MAP_APPFONT ( 120 , 200 ) ;
- FixedText FT_BOOKMARKS
- {
- Pos = MAP_APPFONT ( 6 , 6 ) ;
- Size = MAP_APPFONT ( 108 , 10 ) ;
- Text [ en-US ] = "~Bookmarks" ;
- };
- ListBox LB_BOOKMARKS
- {
- HelpID = "sfx2:ListBox:TP_HELP_BOOKMARKS:LB_BOOKMARKS";
- Border = TRUE ;
- Sort = TRUE;
- Pos = MAP_APPFONT ( 6 , 19 ) ;
- Size = MAP_APPFONT ( 108 , 97 ) ;
- };
- PushButton PB_BOOKMARKS
- {
- HelpID = "sfx2:PushButton:TP_HELP_BOOKMARKS:PB_BOOKMARKS";
- Pos = MAP_APPFONT ( 64 , 119 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- Text [ en-US ] = "~Display" ;
- };
-};
-
TabPage TP_HELP_CONTENT
{
HelpId = HID_HELP_TABPAGE_CONTENTS;
diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc
index 24fdd84f3b5b..240acad4cf66 100644
--- a/sfx2/source/inc/helpid.hrc
+++ b/sfx2/source/inc/helpid.hrc
@@ -107,7 +107,6 @@
#define HID_HELP_TABPAGE_CONTENTS "SFX2_HID_HELP_TABPAGE_CONTENTS"
#define HID_HELP_TABPAGE_INDEX "SFX2_HID_HELP_TABPAGE_INDEX"
#define HID_HELP_TABPAGE_SEARCH "SFX2_HID_HELP_TABPAGE_SEARCH"
-#define HID_HELP_TABPAGE_BOOKMARKS "SFX2_HID_HELP_TABPAGE_BOOKMARKS"
#define HID_TBXCONTROL_FILENEW "SFX2_HID_TBXCONTROL_FILENEW"
#define HID_HELP_TOOLBOXITEM_SEARCHDIALOG "SFX2_HID_HELP_TOOLBOXITEM_SEARCHDIALOG"
#define HID_HELP_BOOKMARKS_OPEN "SFX2_HID_HELP_BOOKMARKS_OPEN"