[Libreoffice-commits] core.git: 12 commits - framework/inc framework/source framework/uiconfig framework/UIConfig_startmodule.mk vcl/source
Jan Holesovsky
kendy at suse.cz
Thu Jul 18 02:26:23 PDT 2013
framework/UIConfig_startmodule.mk | 4
framework/inc/framework.hrc | 24
framework/source/services/backingwindow.cxx | 715 ++++++-----------------
framework/source/services/backingwindow.hxx | 130 +---
framework/source/services/fwk_services.src | 80 --
framework/uiconfig/startmodule/ui/startcenter.ui | 306 +++++++++
vcl/source/window/builder.cxx | 2
7 files changed, 567 insertions(+), 694 deletions(-)
New commits:
commit 2fc0c9ad1ad7f65a72c00e17432aad87bf9cb8ff
Author: Jan Holesovsky <kendy at suse.cz>
Date: Thu Jul 18 11:18:31 2013 +0200
widget layout: MenuButton needs to extract relief too.
Change-Id: I648d6b83c21728802b391aba4fa279996a1aa8d1
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index a0bfcec..b091bf5 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -732,6 +732,8 @@ namespace
{
WinBits nBits = WB_CENTER|WB_VCENTER|WB_3DLOOK;
+ nBits |= extractRelief(rMap);
+
Button *pWindow = new MenuButton(pParent, nBits);
if (extractStock(rMap))
commit acdfc322e7da5d48dc7a304e5b56fe62a3edb9f5
Author: Jan Holesovsky <kendy at suse.cz>
Date: Thu Jul 18 11:07:59 2013 +0200
Move comment.
Change-Id: I7c35c6878455fd68eaddd75b39009a59352dd2c3
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 0998478..3043e02 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -248,8 +248,8 @@ void BackingWindow::initBackground()
Size aMiddleSize;
if( !! maBackgroundMiddle )
aMiddleSize = maBackgroundMiddle.GetSizePixel();
- // load middle segment
+ // load middle segment
Application::LoadBrandBitmap ("shell/backing_space", maBackgroundMiddle);
// and scale it to previous size
commit 410b4319a7fb3a0a0f025a2180b0b364092da8bb
Author: Jan Holesovsky <kendy at suse.cz>
Date: Thu Jul 18 11:06:32 2013 +0200
startcenter: No need for special GetFocus().
Change-Id: I789f21e035f864d5b7ac84700a62a1c81f53c2be
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 950c1ad..0998478 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -184,15 +184,6 @@ BackingWindow::~BackingWindow()
mxPopupMenu.clear();
}
-void BackingWindow::GetFocus()
-{
- // CRASH
- //if( IsVisible() )
- // mpWriterButton->GrabFocus();
- Window::GetFocus();
-}
-
-
IMPL_LINK( BackingWindow, WindowEventListener, VclSimpleEvent*, pEvent )
{
VclWindowEvent* pWinEvent = dynamic_cast<VclWindowEvent*>( pEvent );
diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx
index 99b005a..1c58f9e 100644
--- a/framework/source/services/backingwindow.hxx
+++ b/framework/source/services/backingwindow.hxx
@@ -119,7 +119,6 @@ namespace framework
virtual void Paint( const Rectangle& rRect );
virtual void Resize();
virtual long Notify( NotifyEvent& rNEvt );
- virtual void GetFocus();
virtual Size GetOptimalSize() const;
commit 8e5e98b609a9dd61f5d8dfa3498f98b8d9b1fb08
Author: Jan Holesovsky <kendy at suse.cz>
Date: Thu Jul 18 11:01:52 2013 +0200
startcenter: Re-introduce code that handles accelerators.
Change-Id: I171de7f63e644c9446a76f6ade592c8242cadcac
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 76b23ea..950c1ad 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -77,7 +77,8 @@ const int nLogoHeight = 150;
BackingWindow::BackingWindow( Window* i_pParent ) :
Window( i_pParent ),
mbInitControls( false ),
- mnHideExternalLinks( 0 )
+ mnHideExternalLinks( 0 ),
+ mpAccExec( NULL )
{
m_pUIBuilder = new VclBuilder(this, getUIRootDir(),
"modules/StartModule/ui/startcenter.ui",
@@ -412,6 +413,86 @@ void BackingWindow::Paint( const Rectangle& )
long BackingWindow::Notify( NotifyEvent& rNEvt )
{
+ if( rNEvt.GetType() == EVENT_KEYINPUT )
+ {
+ // try the 'normal' accelerators (so that eg. Ctrl+Q works)
+ if( !mpAccExec )
+ {
+ mpAccExec = svt::AcceleratorExecute::createAcceleratorHelper();
+ mpAccExec->init( comphelper::getProcessComponentContext(), mxFrame);
+ }
+
+ const KeyEvent* pEvt = rNEvt.GetKeyEvent();
+ const KeyCode& rKeyCode(pEvt->GetKeyCode());
+ if( pEvt && mpAccExec->execute(rKeyCode) )
+ return 1;
+
+ // #i110344# extrawurst: specialized arrow key control
+ if( rKeyCode.GetModifier() == 0 )
+ {
+ if( rKeyCode.GetCode() == KEY_RIGHT )
+ {
+ if( mpWriterButton->HasFocus() )
+ mpDrawButton->GrabFocus();
+ else if( mpCalcButton->HasFocus() )
+ mpDBButton->GrabFocus();
+ else if( mpImpressButton->HasFocus() )
+ mpMathButton->GrabFocus();
+ else if( mpOpenButton->HasFocus() )
+ mpTemplateButton->GrabFocus();
+ return 1;
+ }
+ else if( rKeyCode.GetCode() == KEY_LEFT )
+ {
+ if( mpDrawButton->HasFocus() )
+ mpWriterButton->GrabFocus();
+ else if( mpDBButton->HasFocus() )
+ mpCalcButton->GrabFocus();
+ else if( mpMathButton->HasFocus() )
+ mpImpressButton->GrabFocus();
+ else if( mpTemplateButton->HasFocus() )
+ mpOpenButton->GrabFocus();
+ return 1;
+ }
+ else if( rKeyCode.GetCode() == KEY_UP )
+ {
+ // first column
+ if( mpOpenButton->HasFocus() )
+ mpImpressButton->GrabFocus();
+ else if( mpImpressButton->HasFocus() )
+ mpCalcButton->GrabFocus();
+ else if( mpCalcButton->HasFocus() )
+ mpWriterButton->GrabFocus();
+ // second column
+ else if( mpTemplateButton->HasFocus() )
+ mpMathButton->GrabFocus();
+ else if( mpMathButton->HasFocus() )
+ mpDBButton->GrabFocus();
+ else if( mpDBButton->HasFocus() )
+ mpDrawButton->GrabFocus();
+ return 1;
+ }
+ else if( rKeyCode.GetCode() == KEY_DOWN )
+ {
+ // first column
+ if( mpWriterButton->HasFocus() )
+ mpCalcButton->GrabFocus();
+ else if( mpCalcButton->HasFocus() )
+ mpImpressButton->GrabFocus();
+ else if( mpImpressButton->HasFocus() )
+ mpOpenButton->GrabFocus();
+ // second column
+ else if( mpDrawButton->HasFocus() )
+ mpDBButton->GrabFocus();
+ else if( mpDBButton->HasFocus() )
+ mpMathButton->GrabFocus();
+ else if( mpMathButton->HasFocus() )
+ mpTemplateButton->GrabFocus();
+ return 1;
+ }
+ }
+ }
+
return Window::Notify( rNEvt );
}
diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx
index 03f6af1..99b005a 100644
--- a/framework/source/services/backingwindow.hxx
+++ b/framework/source/services/backingwindow.hxx
@@ -29,6 +29,7 @@
#include <vcl/toolbox.hxx>
#include <vcl/layout.hxx>
+#include <svtools/acceleratorexecute.hxx>
#include <unotools/moduleoptions.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
@@ -86,12 +87,11 @@ namespace framework
bool mbInitControls;
sal_Int32 mnHideExternalLinks;
+ svt::AcceleratorExecute* mpAccExec;
int mnSCWidth;
int mnSCHeight;
- void loadImage( const ResId& i_rId, PushButton& i_rButton );
-
void setupButton( PushButton* pButton, const OUString& rURL, const std::set<OUString>& rURLS,
SvtModuleOptions& rOpt, SvtModuleOptions::EModule eMod );
commit d05bf07eb7535ae6459567567ae48b1f58918ff6
Author: Jan Holesovsky <kendy at suse.cz>
Date: Thu Jul 18 10:44:52 2013 +0200
startcenter: The explicit Show() is not necessary.
Change-Id: I6e817a6c5465adb02f5431737f2ac649ac0274a5
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 219b36e..76b23ea 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -160,8 +160,6 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
// init background
initBackground();
-
- Window::Show();
}
commit 7cd028fa8a3d89b747a9bfce79a0f8f4f37f8280
Author: Jan Holesovsky <kendy at suse.cz>
Date: Thu Jul 18 10:40:43 2013 +0200
startcenter: Remove unused headers & members, move consts to .cxx.
Change-Id: Id163a02ac663141f113195bfc68fcedd6c4dc500
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 6d246be..219b36e 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -20,42 +20,24 @@
#include "backingwindow.hxx"
#include <services.h>
-#include <sal/macros.h>
+#include <vcl/svapp.hxx>
+#include <vcl/virdev.hxx>
-#include "vcl/metric.hxx"
-#include "vcl/mnemonic.hxx"
-#include "vcl/menu.hxx"
-#include "vcl/svapp.hxx"
-#include "vcl/virdev.hxx"
+#include <unotools/dynamicmenuoptions.hxx>
+#include <svtools/langhelp.hxx>
+#include <svtools/colorcfg.hxx>
-#include "tools/urlobj.hxx"
-
-#include "unotools/dynamicmenuoptions.hxx"
-#include "unotools/historyoptions.hxx"
-#include "svtools/imagemgr.hxx"
-#include "svtools/langhelp.hxx"
-#include "svtools/colorcfg.hxx"
-
-#include "comphelper/processfactory.hxx"
-#include "comphelper/sequenceashashmap.hxx"
-#include "comphelper/configurationhelper.hxx"
+#include <comphelper/processfactory.hxx>
+#include <comphelper/sequenceashashmap.hxx>
#include <toolkit/awt/vclxmenu.hxx>
-#include "cppuhelper/implbase1.hxx"
-
-#include "rtl/strbuf.hxx"
-#include "rtl/ustrbuf.hxx"
-#include "osl/file.h"
-
-#include "com/sun/star/frame/Desktop.hpp"
-#include "com/sun/star/lang/XMultiServiceFactory.hpp"
-#include "com/sun/star/container/XNameAccess.hpp"
-#include "com/sun/star/configuration/theDefaultProvider.hpp"
-#include "com/sun/star/system/SystemShellExecute.hpp"
-#include "com/sun/star/system/SystemShellExecuteFlags.hpp"
-#include "com/sun/star/task/XJobExecutor.hpp"
-#include "com/sun/star/util/XStringWidth.hpp"
+#include <com/sun/star/frame/Desktop.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/configuration/theDefaultProvider.hpp>
+#include <com/sun/star/system/SystemShellExecute.hpp>
+#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/frame/PopupMenuControllerFactory.hpp>
@@ -76,11 +58,26 @@ const char MATH_URL[] = "private:factory/smath";
const char TEMPLATE_URL[] = "slot:5500";
const char OPEN_URL[] = ".uno:Open";
+const int nItemId_Extensions = 1;
+const int nItemId_Info = 3;
+const int nItemId_TplRep = 4;
+
+const int nShadowTop = 30;
+const int nShadowLeft = 30;
+const int nShadowRight = 30;
+const int nShadowBottom = 30;
+
+const int nPaddingTop = 30;
+const int nPaddingLeft = 50;
+const int nPaddingRight = 50;
+const int nPaddingBottom = 30;
+
+const int nLogoHeight = 150;
+
BackingWindow::BackingWindow( Window* i_pParent ) :
Window( i_pParent ),
mbInitControls( false ),
- mnHideExternalLinks( 0 ),
- mpAccExec( NULL )
+ mnHideExternalLinks( 0 )
{
m_pUIBuilder = new VclBuilder(this, getUIRootDir(),
"modules/StartModule/ui/startcenter.ui",
@@ -164,18 +161,12 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
// init background
initBackground();
- // set a slighly larger font than normal labels on the texts
- maTextFont.SetSize( Size( 0, 11 ) );
- maTextFont.SetWeight( WEIGHT_NORMAL );
-
Window::Show();
}
BackingWindow::~BackingWindow()
{
- delete mpAccExec;
-
if( mxPopupMenuController.is() )
{
Reference< lang::XComponent > xComponent( mxPopupMenuController, UNO_QUERY );
@@ -291,8 +282,8 @@ void BackingWindow::initBackground()
mpOpenButton->SetActivateHdl( LINK( this, BackingWindow, ActivateHdl ) );
// this will be moved to somewhere saner later
- nSCWidth = 780;
- nSCHeight = maBackgroundLeft.GetSizePixel().Height();
+ mnSCWidth = 780;
+ mnSCHeight = maBackgroundLeft.GetSizePixel().Height();
}
void BackingWindow::initControls()
@@ -358,9 +349,13 @@ void BackingWindow::setupButton( PushButton* pButton, const OUString &rURL,
pButton->Enable( sal_False );
}
- // setup text
- pButton->SetFont( maTextFont );
- pButton->SetControlFont( maTextFont );
+ // setup text - slighly larger font than normal labels on the texts
+ Font aFont;
+ aFont.SetSize( Size( 0, 11 ) );
+ aFont.SetWeight( WEIGHT_NORMAL );
+
+ pButton->SetFont( aFont );
+ pButton->SetControlFont( aFont );
}
void BackingWindow::setupExternalLink( PushButton* pButton )
@@ -380,9 +375,9 @@ void BackingWindow::Paint( const Rectangle& )
Wallpaper aBack( svtools::ColorConfig().GetColorValue(::svtools::APPBACKGROUND).nColor );
Region aClip( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
- Rectangle aBmpRect(Point((GetOutputSizePixel().Width()-nSCWidth)/2,
- (GetOutputSizePixel().Height()-nSCHeight)/2),
- Size(nSCWidth,nSCHeight));
+ Rectangle aBmpRect(Point((GetOutputSizePixel().Width()-mnSCWidth)/2,
+ (GetOutputSizePixel().Height()-mnSCHeight)/2),
+ Size(mnSCWidth,mnSCHeight));
aClip.Exclude( aBmpRect );
Push( PUSH_CLIPREGION );
@@ -397,7 +392,7 @@ void BackingWindow::Paint( const Rectangle& )
aDev.DrawWallpaper( Rectangle( aOffset, GetOutputSizePixel() ), aBack );
maBackgroundMiddle.Scale(
- Size(nSCWidth - maBackgroundLeft.GetSizePixel().Width() - maBackgroundRight.GetSizePixel().Width(),
+ Size(mnSCWidth - maBackgroundLeft.GetSizePixel().Width() - maBackgroundRight.GetSizePixel().Width(),
maBackgroundMiddle.GetSizePixel().Height()),
BMP_SCALE_FAST);
@@ -432,10 +427,10 @@ void BackingWindow::setOwningFrame( const com::sun::star::uno::Reference< com::s
void BackingWindow::Resize()
{
maStartCentButtons = Rectangle(
- Point((GetOutputSizePixel().Width()-nSCWidth)/2 + nShadowTop + nPaddingTop,
- (GetOutputSizePixel().Height()-nSCHeight)/2 + nShadowLeft + nPaddingLeft + nLogoHeight),
- Size(nSCWidth - nShadowLeft - nShadowRight - nPaddingLeft - nPaddingRight,
- nSCHeight - nShadowTop - nShadowBottom - nPaddingTop - nPaddingBottom - nLogoHeight));
+ Point((GetOutputSizePixel().Width()-mnSCWidth)/2 + nShadowTop + nPaddingTop,
+ (GetOutputSizePixel().Height()-mnSCHeight)/2 + nShadowLeft + nPaddingLeft + nLogoHeight),
+ Size(mnSCWidth - nShadowLeft - nShadowRight - nPaddingLeft - nPaddingRight,
+ mnSCHeight - nShadowTop - nShadowBottom - nPaddingTop - nPaddingBottom - nLogoHeight));
if (isLayoutEnabled(this))
VclContainer::setLayoutAllocation(*GetWindow(WINDOW_FIRSTCHILD),
maStartCentButtons.TopLeft(), maStartCentButtons.GetSize());
diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx
index 05b72c5..03f6af1 100644
--- a/framework/source/services/backingwindow.hxx
+++ b/framework/source/services/backingwindow.hxx
@@ -20,35 +20,33 @@
#ifndef FRAMEWORK_BACKINGWINDOW_HXX
#define FRAMEWORK_BACKINGWINDOW_HXX
-#include "rtl/ustring.hxx"
+#include <rtl/ustring.hxx>
-#include "vcl/builder.hxx"
-#include "vcl/button.hxx"
-#include "vcl/menubtn.hxx"
-#include "vcl/fixed.hxx"
-#include "vcl/bitmapex.hxx"
-#include "vcl/toolbox.hxx"
-#include "vcl/layout.hxx"
+#include <vcl/builder.hxx>
+#include <vcl/button.hxx>
+#include <vcl/menubtn.hxx>
+#include <vcl/bitmapex.hxx>
+#include <vcl/toolbox.hxx>
+#include <vcl/layout.hxx>
-#include "unotools/moduleoptions.hxx"
-#include "svtools/acceleratorexecute.hxx"
+#include <unotools/moduleoptions.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/frame/XUIControllerFactory.hpp>
#include <com/sun/star/frame/XPopupMenuController.hpp>
#include <com/sun/star/awt/XPopupMenu.hpp>
-#include "com/sun/star/frame/XDispatchProvider.hpp"
-#include "com/sun/star/frame/XDesktop.hpp"
-#include "com/sun/star/frame/XFrame.hpp"
-#include "com/sun/star/frame/XTerminateListener.hpp"
-#include "com/sun/star/document/XEventListener.hpp"
-#include "com/sun/star/document/XEventBroadcaster.hpp"
-#include "com/sun/star/util/XURLTransformer.hpp"
-#include "com/sun/star/ui/dialogs/XFilePicker.hpp"
-#include "com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp"
-#include "com/sun/star/ui/dialogs/XFilterManager.hpp"
-#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
-#include "com/sun/star/ui/dialogs/ExecutableDialogResults.hpp"
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/frame/XDesktop.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XTerminateListener.hpp>
+#include <com/sun/star/document/XEventListener.hpp>
+#include <com/sun/star/document/XEventBroadcaster.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
+#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
+#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <set>
@@ -84,35 +82,13 @@ namespace framework
BitmapEx maBackgroundMiddle;
BitmapEx maBackgroundRight;
- Font maTextFont;
- Rectangle maControlRect;
-
Rectangle maStartCentButtons;
- Color maLabelTextColor;
-
-
bool mbInitControls;
sal_Int32 mnHideExternalLinks;
- svt::AcceleratorExecute* mpAccExec;
-
- static const int nItemId_Extensions = 1;
- static const int nItemId_Info = 3;
- static const int nItemId_TplRep = 4;
-
- static const int nShadowTop = 30;
- static const int nShadowLeft = 30;
- static const int nShadowRight = 30;
- static const int nShadowBottom = 30;
-
- static const int nPaddingTop = 30;
- static const int nPaddingLeft = 50;
- static const int nPaddingRight = 50;
- static const int nPaddingBottom = 30;
- static const int nLogoHeight = 150;
- int nSCWidth;
- int nSCHeight;
+ int mnSCWidth;
+ int mnSCHeight;
void loadImage( const ResId& i_rId, PushButton& i_rButton );
commit 27a74e74bb17f81b15dc41c0dc37dd4dffaa85cd
Author: Jan Holesovsky <kendy at suse.cz>
Date: Thu Jul 18 09:24:51 2013 +0200
startcenter: Simplify the button setup & make it work better.
This fixes some drawing artifacts previously visible thanks to the
SetPaintTransparent( sal_False ).
Change-Id: Icd6fb222e2d78f02cd298b02afbfa8e652c4566f
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 34277244..6d246be 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -65,16 +65,16 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star;
using namespace framework;
-#define RECENT_FILE_LIST ".uno:RecentFileList"
+const char RECENT_FILE_LIST[] = ".uno:RecentFileList";
-#define WRITER_URL "private:factory/swriter"
-#define CALC_URL "private:factory/scalc"
-#define IMPRESS_WIZARD_URL "private:factory/simpress?slot=6686"
-#define DRAW_URL "private:factory/sdraw"
-#define BASE_URL "private:factory/sdatabase?Interactive"
-#define MATH_URL "private:factory/smath"
-#define TEMPLATE_URL "slot:5500"
-#define OPEN_URL ".uno:Open"
+const char WRITER_URL[] = "private:factory/swriter";
+const char CALC_URL[] = "private:factory/scalc";
+const char IMPRESS_WIZARD_URL[] = "private:factory/simpress?slot=6686";
+const char DRAW_URL[] = "private:factory/sdraw";
+const char BASE_URL[] = "private:factory/sdatabase?Interactive";
+const char MATH_URL[] = "private:factory/smath";
+const char TEMPLATE_URL[] = "slot:5500";
+const char OPEN_URL[] = ".uno:Open";
BackingWindow::BackingWindow( Window* i_pParent ) :
Window( i_pParent ),
@@ -319,106 +319,58 @@ void BackingWindow::initControls()
aFileNewAppsAvailable.insert( sURL );
}
- // create mnemonics on the fly, preregister the mnemonics of the menu
- MnemonicGenerator aMnemns;
-
- SystemWindow* pSysWin = GetSystemWindow();
- if( pSysWin )
- {
- MenuBar* pMBar = pSysWin->GetMenuBar();
- if( pMBar )
- {
- for( sal_uInt16 i = 0; i < pMBar->GetItemCount(); i++ )
- {
- sal_uInt16 nItemId = pMBar->GetItemId( i );
- String aItemText( pMBar->GetItemText( nItemId ) );
- if( aItemText.Len() )
- aMnemns.RegisterMnemonic( aItemText );
- }
- }
- }
-
- // layout the buttons
-
- layoutButton( WRITER_URL, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SWRITER,
- *mpWriterButton, aMnemns );
- layoutButton( DRAW_URL, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SDRAW,
- *mpDrawButton, aMnemns );
- layoutButton( CALC_URL, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SCALC,
- *mpCalcButton, aMnemns );
- layoutButton( BASE_URL, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SDATABASE,
- *mpDBButton, aMnemns );
- layoutButton( IMPRESS_WIZARD_URL, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SIMPRESS,
- *mpImpressButton, aMnemns );
- layoutButton( MATH_URL, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SMATH,
- *mpMathButton, aMnemns );
-
- layoutButton( NULL, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SWRITER,
- *mpOpenButton, aMnemns );
- layoutButton( NULL, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SWRITER,
- *mpTemplateButton, aMnemns );
-
- layoutExternalLink( *mpExtensionsButton );
- layoutExternalLink( *mpInfoButton );
- layoutExternalLink( *mpTplRepButton );
-
- //SAL _DEBUG("container size: " << mpStartCenterContainer->GetSizePixel().Width()
- // << " " << mpStartCenterContainer->GetSizePixel().Height());
+ setupButton( mpWriterButton, WRITER_URL, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SWRITER );
+ setupButton( mpDrawButton, DRAW_URL, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SDRAW );
+ setupButton( mpCalcButton, CALC_URL, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SCALC );
+ setupButton( mpDBButton, BASE_URL, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SDATABASE );
+ setupButton( mpImpressButton, IMPRESS_WIZARD_URL, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SIMPRESS );
+ setupButton( mpMathButton, MATH_URL, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SMATH );
+
+ setupButton( mpOpenButton, "", aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SWRITER );
+ setupButton( mpTemplateButton, "", aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SWRITER );
+
+ setupExternalLink( mpExtensionsButton );
+ setupExternalLink( mpInfoButton );
+ setupExternalLink( mpTplRepButton );
Resize();
mpWriterButton->GrabFocus();
}
-
-void BackingWindow::layoutButton(
- const char* i_pURL,
- const std::set<OUString>& i_rURLS,
- SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod,
- PushButton& i_rBtn,
- MnemonicGenerator& i_rMnemns,
- const String& i_rStr
- )
+void BackingWindow::setupButton( PushButton* pButton, const OUString &rURL,
+ const std::set<OUString>& rURLS,
+ SvtModuleOptions& rOpt, SvtModuleOptions::EModule eMod )
{
- OUString aURL( i_pURL ? OUString::createFromAscii( i_pURL ) : OUString() );
- // setup button
- i_rBtn.SetPaintTransparent( sal_False );
- i_rBtn.SetClickHdl( LINK( this, BackingWindow, ClickHdl ) );
- if( i_pURL && (! i_rOpt.IsModuleInstalled( i_eMod ) || i_rURLS.find( aURL ) == i_rURLS.end()) )
+ pButton->SetClickHdl( LINK( this, BackingWindow, ClickHdl ) );
+
+ // disable the parts that are not installed
+ if( !rURL.isEmpty() && (!rOpt.IsModuleInstalled( eMod ) || rURLS.find( rURL ) == rURLS.end()) )
{
- i_rBtn.Enable( sal_False );
+ pButton->Enable( sal_False );
}
// setup text
- i_rBtn.SetFont( maTextFont );
- i_rBtn.SetControlFont( maTextFont );
-
- String aText( i_rStr.Len() ? i_rStr : SvFileInformationManager::GetDescription( INetURLObject( aURL ) ) );
- i_rMnemns.CreateMnemonic( aText );
- i_rBtn.SetText( aText );
-
- //without this line, imagebuttons with text don't work properly
- i_rBtn.SetImageAlign( IMAGEALIGN_LEFT );
-
- // show the controls
- i_rBtn.Show();
+ pButton->SetFont( maTextFont );
+ pButton->SetControlFont( maTextFont );
}
-void BackingWindow::layoutExternalLink( PushButton& i_rBtn )
+void BackingWindow::setupExternalLink( PushButton* pButton )
{
- i_rBtn.SetPaintTransparent( sal_False );
- i_rBtn.SetClickHdl( LINK( this, BackingWindow, ExtLinkClickHdl ) );
-
if( mnHideExternalLinks == 0 )
- i_rBtn.Show();
+ pButton->Show();
+ else
+ pButton->Hide();
+
+ pButton->SetClickHdl( LINK( this, BackingWindow, ExtLinkClickHdl ) );
}
void BackingWindow::Paint( const Rectangle& )
@@ -463,7 +415,6 @@ void BackingWindow::Paint( const Rectangle& )
DrawOutDev( aBmpRect.TopLeft(), aBmpRect.GetSize(),
Point( 0, 0 ), aBmpRect.GetSize(),
aDev );
-
}
long BackingWindow::Notify( NotifyEvent& rNEvt )
@@ -669,7 +620,7 @@ Size BackingWindow::GetOptimalSize() const
if (isLayoutEnabled(this))
return VclContainer::getLayoutRequisition(*GetWindow(WINDOW_FIRSTCHILD));
- return Window::GetOptimalSize();
+ return Window::GetOptimalSize();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab:*/
diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx
index ee94326..05b72c5 100644
--- a/framework/source/services/backingwindow.hxx
+++ b/framework/source/services/backingwindow.hxx
@@ -116,14 +116,10 @@ namespace framework
void loadImage( const ResId& i_rId, PushButton& i_rButton );
- void layoutButton( const char* i_pURL, const std::set<OUString>& i_rURLS,
- SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod,
- PushButton& i_rBtn,
- MnemonicGenerator& i_rMnemonicGen,
- const String& i_rStr = String()
- );
-
- void layoutExternalLink( PushButton& i_rBtn );
+ void setupButton( PushButton* pButton, const OUString& rURL, const std::set<OUString>& rURLS,
+ SvtModuleOptions& rOpt, SvtModuleOptions::EModule eMod );
+
+ void setupExternalLink( PushButton* pButton );
void dispatchURL( const OUString& i_rURL,
const OUString& i_rTarget = OUString( "_default" ),
commit 0b07c120a0236b9a9ac5e93f98770c94c06fcd3d
Author: Jan Holesovsky <kendy at suse.cz>
Date: Thu Jul 18 08:54:50 2013 +0200
startcenter: Make the Open button work as a MenuButton.
Change-Id: Ic02a271c0c2b892e0dca0a07a5c2ff9a7862ab9f
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 61f1328..34277244 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -221,7 +221,6 @@ IMPL_LINK( BackingWindow, WindowEventListener, VclSimpleEvent*, pEvent )
return 0;
}
-/*
void BackingWindow::prepareRecentFileMenu()
{
if( ! mxPopupMenu.is() )
@@ -259,7 +258,6 @@ void BackingWindow::prepareRecentFileMenu()
mpOpenButton->SetPopupMenu( pRecentMenu );
}
}
-*/
void BackingWindow::initBackground()
{
@@ -289,9 +287,8 @@ void BackingWindow::initBackground()
Application::LoadBrandBitmap ("shell/backing_right", maBackgroundRight);
}
- // CRASH
- //mpOpenButton->SetMenuMode( MENUBUTTON_MENUMODE_TIMED );
- //mpOpenButton->SetActivateHdl( LINK( this, BackingWindow, ActivateHdl ) );
+ mpOpenButton->SetMenuMode( MENUBUTTON_MENUMODE_TIMED );
+ mpOpenButton->SetActivateHdl( LINK( this, BackingWindow, ActivateHdl ) );
// this will be moved to somewhere saner later
nSCWidth = 780;
@@ -582,14 +579,12 @@ IMPL_LINK( BackingWindow, ClickHdl, Button*, pButton )
return 0;
}
-/*
IMPL_LINK( BackingWindow, ActivateHdl, Button*, pButton )
{
if( pButton == mpOpenButton )
prepareRecentFileMenu();
return 0;
}
-*/
struct ImplDelayedDispatch
{
diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx
index 2c41356..ee94326 100644
--- a/framework/source/services/backingwindow.hxx
+++ b/framework/source/services/backingwindow.hxx
@@ -65,22 +65,20 @@ namespace framework
com::sun::star::uno::Reference< com::sun::star::frame::XPopupMenuController > mxPopupMenuController;
com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu > mxPopupMenu;
- PushButton* mpWriterButton;
- PushButton* mpCalcButton;
- PushButton* mpImpressButton;
- //MenuButton* mpOpenButton;
- PushButton* mpOpenButton;
- PushButton* mpDrawButton;
- PushButton* mpDBButton;
- PushButton* mpMathButton;
- PushButton* mpTemplateButton;
+ PushButton* mpWriterButton;
+ PushButton* mpCalcButton;
+ PushButton* mpImpressButton;
+ MenuButton* mpOpenButton;
+ PushButton* mpDrawButton;
+ PushButton* mpDBButton;
+ PushButton* mpMathButton;
+ PushButton* mpTemplateButton;
+ PushButton* mpExtensionsButton;
+ PushButton* mpInfoButton;
+ PushButton* mpTplRepButton;
- PushButton* mpExtensionsButton;
- PushButton* mpInfoButton;
- PushButton* mpTplRepButton;
-
- VclGrid* mpStartCenterContainer;
+ VclGrid* mpStartCenterContainer;
BitmapEx maBackgroundLeft;
BitmapEx maBackgroundMiddle;
@@ -135,13 +133,14 @@ namespace framework
DECL_LINK( ClickHdl, Button* );
DECL_LINK( ExtLinkClickHdl, Button* );
- //DECL_LINK( ActivateHdl, Button* );
+ DECL_LINK( ActivateHdl, Button* );
DECL_LINK( WindowEventListener, VclSimpleEvent* );
void initControls();
void initBackground();
- //void prepareRecentFileMenu();
- public:
+ void prepareRecentFileMenu();
+
+ public:
BackingWindow( Window* pParent );
~BackingWindow();
diff --git a/framework/uiconfig/startmodule/ui/startcenter.ui b/framework/uiconfig/startmodule/ui/startcenter.ui
index 1a4d9d6..33c6e17 100644
--- a/framework/uiconfig/startmodule/ui/startcenter.ui
+++ b/framework/uiconfig/startmodule/ui/startcenter.ui
@@ -185,7 +185,7 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="open">
+ <object class="GtkButton" id="open:addmenu">
<property name="label" translatable="yes">Ope_n...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
commit 82b4dbf25ed6641f4baf6d3fa5183bdc00baca69
Author: Jan Holesovsky <kendy at suse.cz>
Date: Wed Jul 17 17:14:14 2013 +0200
startcenter: The window & strings are initialized in .ui, remove from .src.
Change-Id: I951e4bc12696a2cb5b1b93f28de25cd4783b9387
diff --git a/framework/inc/framework.hrc b/framework/inc/framework.hrc
index 12c9954..1e97280 100644
--- a/framework/inc/framework.hrc
+++ b/framework/inc/framework.hrc
@@ -31,16 +31,6 @@
#define DLG_FILTER_SELECT (RID_FWK_DIALOG_START_CORRECT + 0)
-
-// ResIds for BackingWindow
-#define DLG_BACKING (RID_FWK_DIALOG_START_CORRECT+100)
-#define STR_BACKING_CREATE 1
-#define STR_BACKING_TEMPLATE 2
-#define STR_BACKING_FILE 3
-#define STR_BACKING_EXTHELP 4
-#define STR_BACKING_INFOHELP 5
-#define STR_BACKING_TPLREP 6
-
// Ids of TabWindow
#define WIN_TABWINDOW (RID_FWK_DIALOG_START_CORRECT+101)
#define TC_TABCONTROL 1
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 8604d81..61f1328 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -18,9 +18,6 @@
*/
#include "backingwindow.hxx"
-#include "classes/resource.hrc"
-#include "framework.hrc"
-#include "classes/fwkresid.hxx"
#include <services.h>
#include <sal/macros.h>
@@ -36,7 +33,6 @@
#include "unotools/dynamicmenuoptions.hxx"
#include "unotools/historyoptions.hxx"
#include "svtools/imagemgr.hxx"
-#include "svtools/svtools.hrc"
#include "svtools/langhelp.hxx"
#include "svtools/colorcfg.hxx"
@@ -81,9 +77,7 @@ using namespace framework;
#define OPEN_URL ".uno:Open"
BackingWindow::BackingWindow( Window* i_pParent ) :
- Window( i_pParent , FwkResId( DLG_BACKING ) ),
- maOpenString( FwkResId( STR_BACKING_FILE ) ),
- maTemplateString( FwkResId( STR_BACKING_TEMPLATE ) ),
+ Window( i_pParent ),
mbInitControls( false ),
mnHideExternalLinks( 0 ),
mpAccExec( NULL )
@@ -330,8 +324,6 @@ void BackingWindow::initControls()
// create mnemonics on the fly, preregister the mnemonics of the menu
MnemonicGenerator aMnemns;
- maTemplateString = MnemonicGenerator::EraseAllMnemonicChars( maTemplateString );
- maOpenString = MnemonicGenerator::EraseAllMnemonicChars( maOpenString );
SystemWindow* pSysWin = GetSystemWindow();
if( pSysWin )
@@ -372,10 +364,10 @@ void BackingWindow::initControls()
layoutButton( NULL, aFileNewAppsAvailable,
aModuleOptions, SvtModuleOptions::E_SWRITER,
- *mpOpenButton, aMnemns, maOpenString );
+ *mpOpenButton, aMnemns );
layoutButton( NULL, aFileNewAppsAvailable,
aModuleOptions, SvtModuleOptions::E_SWRITER,
- *mpTemplateButton, aMnemns, maTemplateString );
+ *mpTemplateButton, aMnemns );
layoutExternalLink( *mpExtensionsButton );
layoutExternalLink( *mpInfoButton );
diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx
index d52a8cb..2c41356 100644
--- a/framework/source/services/backingwindow.hxx
+++ b/framework/source/services/backingwindow.hxx
@@ -86,10 +86,6 @@ namespace framework
BitmapEx maBackgroundMiddle;
BitmapEx maBackgroundRight;
- String maCreateString;
- String maOpenString;
- String maTemplateString;
-
Font maTextFont;
Rectangle maControlRect;
diff --git a/framework/source/services/fwk_services.src b/framework/source/services/fwk_services.src
index eadba81..00f6b16 100644
--- a/framework/source/services/fwk_services.src
+++ b/framework/source/services/fwk_services.src
@@ -19,38 +19,6 @@
#include "framework.hrc"
-Window DLG_BACKING
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Border = FALSE;
-
- String STR_BACKING_CREATE
- {
- Text [ en-US ] = "Create a new document";
- };
- String STR_BACKING_TEMPLATE
- {
- Text [ en-US ] = "~Templates...";
- };
- String STR_BACKING_FILE
- {
- Text [ en-US ] = "~Open...";
- };
- String STR_BACKING_EXTHELP
- {
- Text [ en-US ] = "Add new features to %PRODUCTNAME";
- };
- String STR_BACKING_INFOHELP
- {
- Text [ en-US ] = "Get more information about %PRODUCTNAME";
- };
- String STR_BACKING_TPLREP
- {
- Text [ en-US ] = "Get more templates for %PRODUCTNAME";
- };
-};
-
Window WIN_TABWINDOW
{
OutputSize = TRUE ;
diff --git a/framework/uiconfig/startmodule/ui/startcenter.ui b/framework/uiconfig/startmodule/ui/startcenter.ui
index 8839a63..1a4d9d6 100644
--- a/framework/uiconfig/startmodule/ui/startcenter.ui
+++ b/framework/uiconfig/startmodule/ui/startcenter.ui
@@ -46,6 +46,11 @@
<property name="can_focus">False</property>
<property name="pixbuf">framework/res/folder_32.png</property>
</object>
+ <object class="GtkImage" id="templates_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">framework/res/templates_32.png</property>
+ </object>
<object class="GtkImage" id="writer_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -236,6 +241,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes">Add new features to %PRODUCTNAME</property>
<property name="image">extension_image</property>
<property name="relief">none</property>
<property name="always_show_image">True</property>
@@ -252,6 +258,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes">Get more information about %PRODUCTNAME</property>
<property name="image">info_image</property>
<property name="relief">none</property>
<property name="always_show_image">True</property>
@@ -268,6 +275,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="tooltip_text" translatable="yes">Get more templates for %PRODUCTNAME</property>
<property name="image">add_temp_image</property>
<property name="relief">none</property>
<property name="always_show_image">True</property>
@@ -295,9 +303,4 @@
</packing>
</child>
</object>
- <object class="GtkImage" id="templates_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">framework/res/templates_32.png</property>
- </object>
</interface>
commit 019cec3ea4cfb94f0fa2689efb73019182390bed
Author: Jan Holesovsky <kendy at suse.cz>
Date: Wed Jul 17 17:02:44 2013 +0200
startcenter: The images have moved to .ui, remove from .src.
Change-Id: Ib83a8903062f40f9e64d93a2afe5d7d088f8451a
diff --git a/framework/inc/framework.hrc b/framework/inc/framework.hrc
index 861c447..12c9954 100644
--- a/framework/inc/framework.hrc
+++ b/framework/inc/framework.hrc
@@ -41,20 +41,6 @@
#define STR_BACKING_INFOHELP 5
#define STR_BACKING_TPLREP 6
-#define RES_BACKING_IMAGES (DLG_BACKING+1)
-
-#define BMP_BACKING_EXT 6
-#define BMP_BACKING_INFO 8
-#define BMP_BACKING_TPLREP 9
-#define BMP_BACKING_WRITER 10
-#define BMP_BACKING_CALC 11
-#define BMP_BACKING_IMPRESS 12
-#define BMP_BACKING_DRAW 13
-#define BMP_BACKING_DATABASE 14
-#define BMP_BACKING_FORMULA 15
-#define BMP_BACKING_OPENFILE 16
-#define BMP_BACKING_OPENTEMPLATE 17
-
// Ids of TabWindow
#define WIN_TABWINDOW (RID_FWK_DIALOG_START_CORRECT+101)
#define TC_TABCONTROL 1
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 1117246..8604d81 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -209,14 +209,6 @@ void BackingWindow::GetFocus()
}
-class ImageContainerRes : public Resource
-{
- public:
- ImageContainerRes( const ResId& i_rId ) : Resource( i_rId ) {}
- ~ImageContainerRes() { FreeResource(); }
-};
-
-
IMPL_LINK( BackingWindow, WindowEventListener, VclSimpleEvent*, pEvent )
{
VclWindowEvent* pWinEvent = dynamic_cast<VclWindowEvent*>( pEvent );
@@ -279,9 +271,6 @@ void BackingWindow::initBackground()
{
SetBackground();
- // select image set
- ImageContainerRes aRes( FwkResId( RES_BACKING_IMAGES ) );
-
// scale middle segment
Size aMiddleSize;
if( !! maBackgroundMiddle )
diff --git a/framework/source/services/fwk_services.src b/framework/source/services/fwk_services.src
index 5003cf4..eadba81 100644
--- a/framework/source/services/fwk_services.src
+++ b/framework/source/services/fwk_services.src
@@ -51,54 +51,6 @@ Window DLG_BACKING
};
};
-Resource RES_BACKING_IMAGES
-{
- Bitmap BMP_BACKING_EXT
- {
- File = "extension.png";
- };
- Bitmap BMP_BACKING_INFO
- {
- File = "info_26.png";
- };
- Bitmap BMP_BACKING_TPLREP
- {
- File = "addtemplate_32.png";
- };
- Bitmap BMP_BACKING_WRITER
- {
- File = "odt_32_8.png";
- };
- Bitmap BMP_BACKING_CALC
- {
- File = "ods_32_8.png";
- };
- Bitmap BMP_BACKING_IMPRESS
- {
- File = "odp_32_8.png";
- };
- Bitmap BMP_BACKING_DRAW
- {
- File = "odg_32_8.png";
- };
- Bitmap BMP_BACKING_DATABASE
- {
- File = "odb_32_8.png";
- };
- Bitmap BMP_BACKING_FORMULA
- {
- File = "odf_32_8.png";
- };
- Bitmap BMP_BACKING_OPENFILE
- {
- File = "folder_32.png";
- };
- Bitmap BMP_BACKING_OPENTEMPLATE
- {
- File = "templates_32.png";
- };
-};
-
Window WIN_TABWINDOW
{
OutputSize = TRUE ;
commit 0b3b4d94eade52996acb5efaddcd9faceae55450
Author: Jan Holesovsky <kendy at suse.cz>
Date: Wed Jul 17 17:02:10 2013 +0200
startcenter: Make the widgets in .ui resizable.
Change-Id: Ifc34e80bfcb71e041e7adb444c464ba917fea2b1
diff --git a/framework/uiconfig/startmodule/ui/startcenter.ui b/framework/uiconfig/startmodule/ui/startcenter.ui
index 067c4d5..8839a63 100644
--- a/framework/uiconfig/startmodule/ui/startcenter.ui
+++ b/framework/uiconfig/startmodule/ui/startcenter.ui
@@ -26,15 +26,15 @@
<property name="can_focus">False</property>
<property name="pixbuf">framework/res/extension.png</property>
</object>
- <object class="GtkImage" id="impress_image">
+ <object class="GtkImage" id="info_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="pixbuf">res/odp_32_8.png</property>
+ <property name="pixbuf">framework/res/info_26.png</property>
</object>
- <object class="GtkImage" id="info_image">
+ <object class="GtkImage" id="impress_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="pixbuf">framework/res/info_26.png</property>
+ <property name="pixbuf">res/odp_32_8.png</property>
</object>
<object class="GtkImage" id="math_image">
<property name="visible">True</property>
@@ -46,26 +46,40 @@
<property name="can_focus">False</property>
<property name="pixbuf">framework/res/folder_32.png</property>
</object>
+ <object class="GtkImage" id="writer_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/odt_32_8.png</property>
+ </object>
<object class="GtkBox" id="StartCenter">
<property name="can_focus">False</property>
<child>
<object class="GtkGrid" id="sccontainer">
<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">12</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
<property name="column_homogeneous">True</property>
<child>
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
<property name="column_homogeneous">True</property>
<child>
<object class="GtkButton" id="writer">
- <property name="label" translatable="yes">Text Document</property>
+ <property name="label" translatable="yes">Text _Document</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">writer_image</property>
<property name="relief">none</property>
+ <property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -77,12 +91,13 @@
</child>
<child>
<object class="GtkButton" id="draw">
- <property name="label" translatable="yes">Drawing</property>
+ <property name="label" translatable="yes">D_rawing</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">draw_image</property>
<property name="relief">none</property>
+ <property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -94,12 +109,13 @@
</child>
<child>
<object class="GtkButton" id="calc">
- <property name="label" translatable="yes">Spreadsheet</property>
+ <property name="label" translatable="yes">_Spreadsheet</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">calc_image</property>
<property name="relief">none</property>
+ <property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -111,12 +127,13 @@
</child>
<child>
<object class="GtkButton" id="database">
- <property name="label" translatable="yes">Database</property>
+ <property name="label" translatable="yes">D_atabase</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">database_image</property>
<property name="relief">none</property>
+ <property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -128,12 +145,13 @@
</child>
<child>
<object class="GtkButton" id="impress">
- <property name="label" translatable="yes">Presentation</property>
+ <property name="label" translatable="yes">_Presentation</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">impress_image</property>
<property name="relief">none</property>
+ <property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -145,12 +163,13 @@
</child>
<child>
<object class="GtkButton" id="math">
- <property name="label" translatable="yes">Formula</property>
+ <property name="label" translatable="yes">F_ormula</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">math_image</property>
<property name="relief">none</property>
+ <property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -162,12 +181,13 @@
</child>
<child>
<object class="GtkButton" id="open">
- <property name="label" translatable="yes">Open...</property>
+ <property name="label" translatable="yes">Ope_n...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">open_image</property>
<property name="relief">none</property>
+ <property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -179,12 +199,13 @@
</child>
<child>
<object class="GtkButton" id="templates">
- <property name="label" translatable="yes">Templates...</property>
+ <property name="label" translatable="yes">Te_mplates...</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">templates_image</property>
<property name="relief">none</property>
+ <property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
@@ -206,6 +227,10 @@
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="valign">end</property>
+ <property name="vexpand">True</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
<child>
<object class="GtkButton" id="extension">
<property name="visible">True</property>
@@ -213,6 +238,7 @@
<property name="receives_default">True</property>
<property name="image">extension_image</property>
<property name="relief">none</property>
+ <property name="always_show_image">True</property>
</object>
<packing>
<property name="left_attach">1</property>
@@ -228,6 +254,7 @@
<property name="receives_default">True</property>
<property name="image">info_image</property>
<property name="relief">none</property>
+ <property name="always_show_image">True</property>
</object>
<packing>
<property name="left_attach">2</property>
@@ -243,6 +270,7 @@
<property name="receives_default">True</property>
<property name="image">add_temp_image</property>
<property name="relief">none</property>
+ <property name="always_show_image">True</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -272,9 +300,4 @@
<property name="can_focus">False</property>
<property name="pixbuf">framework/res/templates_32.png</property>
</object>
- <object class="GtkImage" id="writer_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixbuf">res/odt_32_8.png</property>
- </object>
</interface>
commit 7ced337e1f0e1fae81ff7f196e59e558b729bdde
Author: Krisztian Pinter <pin.terminator at gmail.com>
Date: Tue Jun 18 16:59:27 2013 +0200
startcenter: GSOC Use Widget Layout for the Start Center
Known issue: after starting a module from the startcenter,
and closing it, the buttons for the modules remain stuck
after hovering the mouse over them
Change-Id: I50883868764565be62a2f123a832154ef015e763
diff --git a/framework/UIConfig_startmodule.mk b/framework/UIConfig_startmodule.mk
index 6bbb68d..7447b99 100644
--- a/framework/UIConfig_startmodule.mk
+++ b/framework/UIConfig_startmodule.mk
@@ -21,4 +21,8 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/StartModule,\
framework/uiconfig/startmodule/toolbar/standardbar \
))
+$(eval $(call gb_UIConfig_add_uifiles,modules/StartModule,\
+ framework/uiconfig/startmodule/ui/startcenter \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 7dab8c9..1117246 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-// autogen include statement, do not remove
-
#include "backingwindow.hxx"
#include "classes/resource.hrc"
#include "framework.hrc"
@@ -82,81 +80,31 @@ using namespace framework;
#define TEMPLATE_URL "slot:5500"
#define OPEN_URL ".uno:Open"
-DecoToolBox::DecoToolBox( Window* pParent, WinBits nStyle ) :
- ToolBox( pParent, nStyle )
-{
- SetBackground();
- SetPaintTransparent( sal_True );
-}
-
-void DecoToolBox::DataChanged( const DataChangedEvent& rDCEvt )
-{
- Window::DataChanged( rDCEvt );
-
- if ( rDCEvt.GetFlags() & SETTINGS_STYLE )
- {
- calcMinSize();
- SetBackground();
- SetPaintTransparent( sal_True );
- }
-}
-
-void DecoToolBox::calcMinSize()
-{
- ToolBox aTbx( GetParent() );
- sal_uInt16 nItems = GetItemCount();
- for( sal_uInt16 i = 0; i < nItems; i++ )
- {
- sal_uInt16 nId = GetItemId( i );
- aTbx.InsertItem( nId, GetItemImage( nId ) );
- }
- aTbx.SetOutStyle( TOOLBOX_STYLE_FLAT );
- maMinSize = aTbx.CalcWindowSizePixel();
-}
-
-Size DecoToolBox::getMinSize()
-{
- return maMinSize;
-}
-
-class RecentFilesStringLength : public ::cppu::WeakImplHelper1< ::com::sun::star::util::XStringWidth >
-{
- public:
- RecentFilesStringLength() {}
- virtual ~RecentFilesStringLength() {}
-
- // XStringWidth
- sal_Int32 SAL_CALL queryStringWidth( const OUString& aString )
- throw (::com::sun::star::uno::RuntimeException)
- {
- return aString.getLength();
- }
-};
-
-#define STC_BUTTON_STYLE (WB_LEFT | WB_VCENTER | WB_FLATBUTTON | WB_BEVELBUTTON)
-
BackingWindow::BackingWindow( Window* i_pParent ) :
- Window( i_pParent, FwkResId( DLG_BACKING ) ),
- maWriterButton( this, STC_BUTTON_STYLE ),
- maCalcButton( this, STC_BUTTON_STYLE ),
- maImpressButton( this, STC_BUTTON_STYLE ),
- maOpenButton( this, STC_BUTTON_STYLE ),
- maDrawButton( this, STC_BUTTON_STYLE ),
- maDBButton( this, STC_BUTTON_STYLE ),
- maMathButton( this, STC_BUTTON_STYLE ),
- maTemplateButton( this, STC_BUTTON_STYLE ),
- maToolbox( this, WB_DIALOGCONTROL ),
+ Window( i_pParent , FwkResId( DLG_BACKING ) ),
maOpenString( FwkResId( STR_BACKING_FILE ) ),
maTemplateString( FwkResId( STR_BACKING_TEMPLATE ) ),
- maButtonImageSize( 10, 10 ),
mbInitControls( false ),
mnHideExternalLinks( 0 ),
- mpAccExec( NULL ),
- mnBtnPos( 120 ),
- mnBtnTop( 150 )
+ mpAccExec( NULL )
{
- mnColumnWidth[0] = mnColumnWidth[1] = 0;
- mnTextColumnWidth[0] = mnTextColumnWidth[1] = 0;
+ m_pUIBuilder = new VclBuilder(this, getUIRootDir(),
+ "modules/StartModule/ui/startcenter.ui",
+ "StartCenter" );
+ get(mpWriterButton, "writer");
+ get(mpCalcButton, "calc");
+ get(mpImpressButton, "impress");
+ get(mpOpenButton, "open");
+ get(mpDrawButton, "draw");
+ get(mpDBButton, "database");
+ get(mpMathButton, "math");
+ get(mpTemplateButton, "templates");
+
+ get(mpExtensionsButton, "extension");
+ get(mpInfoButton, "info");
+ get(mpTplRepButton, "add_temp");
+
+ get(mpStartCenterContainer, "sccontainer");
try
{
@@ -192,73 +140,46 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
SAL_WARN( "fwk", "BackingWindow - caught an exception! " << e.Message );
}
- OUString aExtHelpText( FwkResId( STR_BACKING_EXTHELP ) );
- OUString aInfoHelpText( FwkResId( STR_BACKING_INFOHELP ) );
- OUString aTplRepHelpText( FwkResId( STR_BACKING_TPLREP ) );
-
// clean up resource stack
- FreeResource();
+ //FreeResource();
// fdo#34392: we do the layout dynamically, the layout depends on the font,
// so we should handle data changed events (font changing) of the last child
// control, at this point all the controls have updated settings (i.e. font).
- maToolbox.AddEventListener( LINK( this, BackingWindow, WindowEventListener ) );
+
EnableChildTransparentMode();
SetStyle( GetStyle() | WB_DIALOGCONTROL );
- // force tab cycling in toolbox
- maToolbox.SetStyle( maToolbox.GetStyle() | WB_FORCETABCYCLE );
-
- // insert toolbox items
- maToolbox.InsertItem( nItemId_TplRep, Image() );
- maToolbox.SetItemText( nItemId_TplRep, aTplRepHelpText );
- maToolbox.SetQuickHelpText( nItemId_TplRep, aTplRepHelpText );
- maToolbox.SetItemCommand( nItemId_TplRep, String( ".HelpId:StartCenter:TemplateRepository" ) );
- maToolbox.ShowItem( nItemId_TplRep );
-
- maToolbox.InsertItem( nItemId_Extensions, Image() );
- maToolbox.SetQuickHelpText( nItemId_Extensions, aExtHelpText );
- maToolbox.SetItemText( nItemId_Extensions, aExtHelpText );
- maToolbox.SetItemCommand( nItemId_Extensions, String( ".HelpId:StartCenter:Extensions" ) );
- maToolbox.ShowItem( nItemId_Extensions );
-
- maToolbox.InsertItem( nItemId_Info, Image() );
- maToolbox.SetItemText( nItemId_Info, aInfoHelpText );
- maToolbox.SetQuickHelpText( nItemId_Info, aInfoHelpText );
- maToolbox.SetItemCommand( nItemId_Info, String( ".HelpId:StartCenter:Info" ) );
- maToolbox.ShowItem( nItemId_Info );
-
// get dispatch provider
Reference<XDesktop2> xDesktop = Desktop::create( comphelper::getProcessComponentContext() );
mxDesktopDispatchProvider = xDesktop;
- maWriterButton.SetHelpId( ".HelpId:StartCenter:WriterButton" );
- maCalcButton.SetHelpId( ".HelpId:StartCenter:CalcButton" );
- maImpressButton.SetHelpId( ".HelpId:StartCenter:ImpressButton" );
- maDrawButton.SetHelpId( ".HelpId:StartCenter:DrawButton" );
- maDBButton.SetHelpId( ".HelpId:StartCenter:DBButton" );
- maMathButton.SetHelpId( ".HelpId:StartCenter:MathButton" );
- maTemplateButton.SetHelpId( ".HelpId:StartCenter:TemplateButton" );
- maOpenButton.SetHelpId( ".HelpId:StartCenter:OpenButton" );
- maToolbox.SetHelpId( ".HelpId:StartCenter:Toolbox" );
+ mpWriterButton->SetHelpId( ".HelpId:StartCenter:WriterButton" );
+ mpCalcButton->SetHelpId( ".HelpId:StartCenter:CalcButton" );
+ mpImpressButton->SetHelpId( ".HelpId:StartCenter:ImpressButton" );
+ mpDrawButton->SetHelpId( ".HelpId:StartCenter:DrawButton" );
+ mpDBButton->SetHelpId( ".HelpId:StartCenter:DBButton" );
+ mpMathButton->SetHelpId( ".HelpId:StartCenter:MathButton" );
+ mpTemplateButton->SetHelpId( ".HelpId:StartCenter:TemplateButton" );
+ mpOpenButton->SetHelpId( ".HelpId:StartCenter:OpenButton" );
+ mpExtensionsButton->SetHelpId( ".HelpId:StartCenter:Extensions" );
+ mpInfoButton->SetHelpId( ".HelpId:StartCenter:Info" );
+ mpTplRepButton->SetHelpId( ".HelpId:StartCenter:TemplateRepository" );
// init background
initBackground();
- // add some breathing space for the images
- maButtonImageSize.Width() += 12;
- maButtonImageSize.Height() += 12;
-
// set a slighly larger font than normal labels on the texts
maTextFont.SetSize( Size( 0, 11 ) );
maTextFont.SetWeight( WEIGHT_NORMAL );
+
+ Window::Show();
}
BackingWindow::~BackingWindow()
{
- maToolbox.RemoveEventListener( LINK( this, BackingWindow, WindowEventListener ) );
delete mpAccExec;
if( mxPopupMenuController.is() )
@@ -281,11 +202,13 @@ BackingWindow::~BackingWindow()
void BackingWindow::GetFocus()
{
- if( IsVisible() )
- maWriterButton.GrabFocus();
+ // CRASH
+ //if( IsVisible() )
+ // mpWriterButton->GrabFocus();
Window::GetFocus();
}
+
class ImageContainerRes : public Resource
{
public:
@@ -293,6 +216,7 @@ class ImageContainerRes : public Resource
~ImageContainerRes() { FreeResource(); }
};
+
IMPL_LINK( BackingWindow, WindowEventListener, VclSimpleEvent*, pEvent )
{
VclWindowEvent* pWinEvent = dynamic_cast<VclWindowEvent*>( pEvent );
@@ -311,6 +235,7 @@ IMPL_LINK( BackingWindow, WindowEventListener, VclSimpleEvent*, pEvent )
return 0;
}
+/*
void BackingWindow::prepareRecentFileMenu()
{
if( ! mxPopupMenu.is() )
@@ -345,21 +270,10 @@ void BackingWindow::prepareRecentFileMenu()
VCLXMenu* pTKMenu = VCLXMenu::GetImplementation( mxPopupMenu );
if ( pTKMenu )
pRecentMenu = dynamic_cast< PopupMenu * >( pTKMenu->GetMenu() );
- maOpenButton.SetPopupMenu( pRecentMenu );
+ mpOpenButton->SetPopupMenu( pRecentMenu );
}
}
-
-namespace
-{
-static void lcl_SetBlackButtonTextColor( PushButton& rButton )
-{
- AllSettings aSettings = rButton.GetSettings();
- StyleSettings aStyleSettings = aSettings.GetStyleSettings();
- aStyleSettings.SetButtonTextColor( Color(COL_BLACK) );
- aSettings.SetStyleSettings( aStyleSettings );
- rButton.SetSettings( aSettings );
-}
-}
+*/
void BackingWindow::initBackground()
{
@@ -391,33 +305,14 @@ void BackingWindow::initBackground()
Application::LoadBrandBitmap ("shell/backing_left", maBackgroundLeft);
Application::LoadBrandBitmap ("shell/backing_right", maBackgroundRight);
}
- maToolbox.SetItemImage( nItemId_Extensions, BitmapEx( FwkResId( BMP_BACKING_EXT ) ) );
-//### maToolbox.SetItemImage( nItemId_Reg, BitmapEx( FwkResId( BMP_BACKING_REG ) ) );
- maToolbox.SetItemImage( nItemId_Info, BitmapEx( FwkResId( BMP_BACKING_INFO ) ) );
- maToolbox.SetItemImage( nItemId_TplRep, BitmapEx( FwkResId( BMP_BACKING_TPLREP ) ) );
-
- // get icon images from fwk resource and set them on the appropriate buttons
- loadImage( FwkResId( BMP_BACKING_WRITER ), maWriterButton );
- loadImage( FwkResId( BMP_BACKING_CALC ), maCalcButton );
- loadImage( FwkResId( BMP_BACKING_IMPRESS ), maImpressButton );
- loadImage( FwkResId( BMP_BACKING_DRAW ), maDrawButton );
- loadImage( FwkResId( BMP_BACKING_DATABASE ), maDBButton );
- loadImage( FwkResId( BMP_BACKING_FORMULA ), maMathButton );
- loadImage( FwkResId( BMP_BACKING_OPENFILE ), maOpenButton );
- loadImage( FwkResId( BMP_BACKING_OPENTEMPLATE ), maTemplateButton );
-
- maOpenButton.SetMenuMode( MENUBUTTON_MENUMODE_TIMED );
- maOpenButton.SetActivateHdl( LINK( this, BackingWindow, ActivateHdl ) );
-
- // fdo#41440: force black text color, since the background image is white.
- lcl_SetBlackButtonTextColor( maWriterButton );
- lcl_SetBlackButtonTextColor( maCalcButton );
- lcl_SetBlackButtonTextColor( maImpressButton );
- lcl_SetBlackButtonTextColor( maOpenButton );
- lcl_SetBlackButtonTextColor( maDrawButton );
- lcl_SetBlackButtonTextColor( maDBButton );
- lcl_SetBlackButtonTextColor( maMathButton );
- lcl_SetBlackButtonTextColor( maTemplateButton );
+
+ // CRASH
+ //mpOpenButton->SetMenuMode( MENUBUTTON_MENUMODE_TIMED );
+ //mpOpenButton->SetActivateHdl( LINK( this, BackingWindow, ActivateHdl ) );
+
+ // this will be moved to somewhere saner later
+ nSCWidth = 780;
+ nSCHeight = maBackgroundLeft.GetSizePixel().Height();
}
void BackingWindow::initControls()
@@ -427,22 +322,6 @@ void BackingWindow::initControls()
mbInitControls = true;
- // calculate dialog size
- // begin with background bitmap
- maControlRect = Rectangle( Point(), maBackgroundLeft.GetSizePixel() );
- maControlRect.Left() += nShadowLeft;
- maControlRect.Right() -= nShadowRight;
- maControlRect.Top() += nShadowTop;
- maControlRect.Bottom() -= nShadowBottom;
-
- long nYPos = 0;
-
- if( maControlRect.GetWidth() < mnBtnPos + 20 )
- maControlRect.Right() = maControlRect.Left() + mnBtnPos + 20;
-
- if( maControlRect.GetWidth() < mnBtnPos + 10 )
- maControlRect.Right() = maControlRect.Left() + mnBtnPos + 10;
-
// collect the URLs of the entries in the File/New menu
SvtModuleOptions aModuleOptions;
std::set< OUString > aFileNewAppsAvailable;
@@ -482,99 +361,48 @@ void BackingWindow::initControls()
}
// layout the buttons
- layoutButton( WRITER_URL, 0, 0, aFileNewAppsAvailable,
+
+ layoutButton( WRITER_URL, aFileNewAppsAvailable,
aModuleOptions, SvtModuleOptions::E_SWRITER,
- maWriterButton, aMnemns );
- layoutButton( DRAW_URL, 1, 0, aFileNewAppsAvailable,
+ *mpWriterButton, aMnemns );
+ layoutButton( DRAW_URL, aFileNewAppsAvailable,
aModuleOptions, SvtModuleOptions::E_SDRAW,
- maDrawButton, aMnemns );
- nYPos += maButtonImageSize.Height() + 10;
- layoutButton( CALC_URL, 0, 0, aFileNewAppsAvailable,
+ *mpDrawButton, aMnemns );
+ layoutButton( CALC_URL, aFileNewAppsAvailable,
aModuleOptions, SvtModuleOptions::E_SCALC,
- maCalcButton, aMnemns );
- layoutButton( BASE_URL, 1, 0, aFileNewAppsAvailable,
+ *mpCalcButton, aMnemns );
+ layoutButton( BASE_URL, aFileNewAppsAvailable,
aModuleOptions, SvtModuleOptions::E_SDATABASE,
- maDBButton, aMnemns );
- nYPos += maButtonImageSize.Height() + 10;
- layoutButton( IMPRESS_WIZARD_URL, 0, 0, aFileNewAppsAvailable,
+ *mpDBButton, aMnemns );
+ layoutButton( IMPRESS_WIZARD_URL, aFileNewAppsAvailable,
aModuleOptions, SvtModuleOptions::E_SIMPRESS,
- maImpressButton, aMnemns );
- layoutButton( MATH_URL, 1, 0, aFileNewAppsAvailable,
+ *mpImpressButton, aMnemns );
+ layoutButton( MATH_URL, aFileNewAppsAvailable,
aModuleOptions, SvtModuleOptions::E_SMATH,
- maMathButton, aMnemns );
+ *mpMathButton, aMnemns );
- nYPos += 3*maButtonImageSize.Height() / 2;
-
- layoutButton( NULL, 0, 18, aFileNewAppsAvailable,
+ layoutButton( NULL, aFileNewAppsAvailable,
aModuleOptions, SvtModuleOptions::E_SWRITER,
- maOpenButton, aMnemns, maOpenString );
- layoutButton( NULL, 1, 0, aFileNewAppsAvailable,
+ *mpOpenButton, aMnemns, maOpenString );
+ layoutButton( NULL, aFileNewAppsAvailable,
aModuleOptions, SvtModuleOptions::E_SWRITER,
- maTemplateButton, aMnemns, maTemplateString );
- nYPos += 10;
+ *mpTemplateButton, aMnemns, maTemplateString );
- DBG_ASSERT( nYPos < maControlRect.GetHeight(), "misformatting !" );
- if( mnColumnWidth[0] + mnColumnWidth[1] + mnBtnPos + 20 > maControlRect.GetWidth() )
- maControlRect.Right() = maControlRect.Left() + mnColumnWidth[0] + mnColumnWidth[1] + mnBtnPos + 20;
+ layoutExternalLink( *mpExtensionsButton );
+ layoutExternalLink( *mpInfoButton );
+ layoutExternalLink( *mpTplRepButton );
- mnTextColumnWidth[0] = mnColumnWidth[0];
- mnTextColumnWidth[1] = mnColumnWidth[1];
-
- if( mnTextColumnWidth[1] > mnTextColumnWidth[0] )
- {
- mnColumnWidth[0] = mnColumnWidth[1];
- mnTextColumnWidth[0] = mnTextColumnWidth[1];
- }
- else
- {
- mnColumnWidth[1] = mnColumnWidth[0];
- mnTextColumnWidth[1] = mnTextColumnWidth[0];
- }
- if( maControlRect.GetWidth() < maControlRect.GetHeight() * 3 / 2 )
- {
- maControlRect.Right() = maControlRect.Left() + maControlRect.GetHeight() * 3 / 2;
- long nDelta = (maControlRect.GetWidth() - mnBtnPos - mnColumnWidth[1] - mnColumnWidth[0] - 20);
- mnColumnWidth[0] += nDelta/2;
- mnColumnWidth[1] += nDelta/2;
- }
-
- maToolbox.SetSelectHdl( LINK( this, BackingWindow, ToolboxHdl ) );
- if( mnHideExternalLinks == 0 )
- maToolbox.Show();
-
- // scale middle map to formatted width
- Size aMiddleSegmentSize( maControlRect.GetSize().Width() + nShadowLeft + nShadowRight,
- maBackgroundMiddle.GetSizePixel().Height() );
-
- long nLW = maBackgroundLeft.GetSizePixel().Width();
- long nRW = maBackgroundRight.GetSizePixel().Width();
- if( aMiddleSegmentSize.Width() > nLW + nRW )
- {
- aMiddleSegmentSize.Width() -= nLW;
- aMiddleSegmentSize.Width() -= nRW;
- maBackgroundMiddle.Scale( aMiddleSegmentSize );
- }
- else
- maBackgroundMiddle = BitmapEx();
+ //SAL _DEBUG("container size: " << mpStartCenterContainer->GetSizePixel().Width()
+ // << " " << mpStartCenterContainer->GetSizePixel().Height());
Resize();
- maWriterButton.GrabFocus();
+ mpWriterButton->GrabFocus();
}
-void BackingWindow::loadImage( const ResId& i_rId, PushButton& i_rButton )
-{
- BitmapEx aBmp( i_rId );
- Size aImgSize( aBmp.GetSizePixel() );
- if( aImgSize.Width() > maButtonImageSize.Width() )
- maButtonImageSize.Width() = aImgSize.Width();
- if( aImgSize.Height() > maButtonImageSize.Height() )
- maButtonImageSize.Height() = aImgSize.Height();
- i_rButton.SetModeImage( aBmp );
-}
void BackingWindow::layoutButton(
- const char* i_pURL, int nColumn, int i_nExtraWidth,
+ const char* i_pURL,
const std::set<OUString>& i_rURLS,
SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod,
PushButton& i_rBtn,
@@ -584,7 +412,7 @@ void BackingWindow::layoutButton(
{
OUString aURL( i_pURL ? OUString::createFromAscii( i_pURL ) : OUString() );
// setup button
- i_rBtn.SetPaintTransparent( sal_True );
+ i_rBtn.SetPaintTransparent( sal_False );
i_rBtn.SetClickHdl( LINK( this, BackingWindow, ClickHdl ) );
if( i_pURL && (! i_rOpt.IsModuleInstalled( i_eMod ) || i_rURLS.find( aURL ) == i_rURLS.end()) )
{
@@ -594,36 +422,39 @@ void BackingWindow::layoutButton(
// setup text
i_rBtn.SetFont( maTextFont );
i_rBtn.SetControlFont( maTextFont );
+
String aText( i_rStr.Len() ? i_rStr : SvFileInformationManager::GetDescription( INetURLObject( aURL ) ) );
i_rMnemns.CreateMnemonic( aText );
i_rBtn.SetText( aText );
- long nTextWidth = i_rBtn.GetTextWidth( i_rBtn.GetText() );
-
- nTextWidth += maButtonImageSize.Width() + 8 + i_nExtraWidth; // add some fuzz to be on the safe side
- if( nColumn >= 0 && nColumn < static_cast<int>(sizeof (mnColumnWidth) / sizeof (mnColumnWidth[0])) )
- {
- if( nTextWidth > mnColumnWidth[nColumn] )
- mnColumnWidth[nColumn] = nTextWidth;
- }
-
+ //without this line, imagebuttons with text don't work properly
i_rBtn.SetImageAlign( IMAGEALIGN_LEFT );
+
// show the controls
i_rBtn.Show();
}
+void BackingWindow::layoutExternalLink( PushButton& i_rBtn )
+{
+ i_rBtn.SetPaintTransparent( sal_False );
+ i_rBtn.SetClickHdl( LINK( this, BackingWindow, ExtLinkClickHdl ) );
+
+ if( mnHideExternalLinks == 0 )
+ i_rBtn.Show();
+}
+
void BackingWindow::Paint( const Rectangle& )
{
Resize();
Wallpaper aBack( svtools::ColorConfig().GetColorValue(::svtools::APPBACKGROUND).nColor );
Region aClip( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
- Rectangle aBmpRect(maControlRect);
- aBmpRect.Left() -= nShadowLeft;
- aBmpRect.Top() -= nShadowTop;
- aBmpRect.Right() += nShadowRight;
- aBmpRect.Bottom() += nShadowBottom;
+
+ Rectangle aBmpRect(Point((GetOutputSizePixel().Width()-nSCWidth)/2,
+ (GetOutputSizePixel().Height()-nSCHeight)/2),
+ Size(nSCWidth,nSCHeight));
aClip.Exclude( aBmpRect );
+
Push( PUSH_CLIPREGION );
IntersectClipRegion( aClip );
DrawWallpaper( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ), aBack );
@@ -632,9 +463,14 @@ void BackingWindow::Paint( const Rectangle& )
VirtualDevice aDev( *this );
aDev.EnableRTL( IsRTLEnabled() );
aDev.SetOutputSizePixel( aBmpRect.GetSize() );
- Point aOffset( Point( 0, 0 ) - aBmpRect.TopLeft() );
+ Point aOffset( Point( 0, 0 ) - aBmpRect.TopLeft());
aDev.DrawWallpaper( Rectangle( aOffset, GetOutputSizePixel() ), aBack );
+ maBackgroundMiddle.Scale(
+ Size(nSCWidth - maBackgroundLeft.GetSizePixel().Width() - maBackgroundRight.GetSizePixel().Width(),
+ maBackgroundMiddle.GetSizePixel().Height()),
+ BMP_SCALE_FAST);
+
// draw bitmap
Point aTL( 0, 0 );
aDev.DrawBitmapEx( aTL, maBackgroundLeft );
@@ -649,87 +485,11 @@ void BackingWindow::Paint( const Rectangle& )
DrawOutDev( aBmpRect.TopLeft(), aBmpRect.GetSize(),
Point( 0, 0 ), aBmpRect.GetSize(),
aDev );
+
}
long BackingWindow::Notify( NotifyEvent& rNEvt )
{
- if( rNEvt.GetType() == EVENT_KEYINPUT )
- {
- if( ! mpAccExec )
- {
- mpAccExec = svt::AcceleratorExecute::createAcceleratorHelper();
- mpAccExec->init( comphelper::getProcessComponentContext(), mxFrame);
- }
-
- const KeyEvent* pEvt = rNEvt.GetKeyEvent();
- const KeyCode& rKeyCode(pEvt->GetKeyCode());
- if( pEvt && mpAccExec->execute(rKeyCode) )
- return 1;
- // #i110344# extrawurst: specialized arrow key control
- if( rKeyCode.GetModifier() == 0 )
- {
- if( rKeyCode.GetCode() == KEY_RIGHT )
- {
- if( maWriterButton.HasFocus() )
- maDrawButton.GrabFocus();
- else if( maCalcButton.HasFocus() )
- maDBButton.GrabFocus();
- else if( maImpressButton.HasFocus() )
- maMathButton.GrabFocus();
- else if( maOpenButton.HasFocus() )
- maTemplateButton.GrabFocus();
- return 1;
- }
- else if( rKeyCode.GetCode() == KEY_LEFT )
- {
- if( maDrawButton.HasFocus() )
- maWriterButton.GrabFocus();
- else if( maDBButton.HasFocus() )
- maCalcButton.GrabFocus();
- else if( maMathButton.HasFocus() )
- maImpressButton.GrabFocus();
- else if( maTemplateButton.HasFocus() )
- maOpenButton.GrabFocus();
- return 1;
- }
- else if( rKeyCode.GetCode() == KEY_UP )
- {
- // first column
- if( maOpenButton.HasFocus() )
- maImpressButton.GrabFocus();
- else if( maImpressButton.HasFocus() )
- maCalcButton.GrabFocus();
- else if( maCalcButton.HasFocus() )
- maWriterButton.GrabFocus();
- // second column
- else if( maTemplateButton.HasFocus() )
- maMathButton.GrabFocus();
- else if( maMathButton.HasFocus() )
- maDBButton.GrabFocus();
- else if( maDBButton.HasFocus() )
- maDrawButton.GrabFocus();
- return 1;
- }
- else if( rKeyCode.GetCode() == KEY_DOWN )
- {
- // first column
- if( maWriterButton.HasFocus() )
- maCalcButton.GrabFocus();
- else if( maCalcButton.HasFocus() )
- maImpressButton.GrabFocus();
- else if( maImpressButton.HasFocus() )
- maOpenButton.GrabFocus();
- // second column
- else if( maDrawButton.HasFocus() )
- maDBButton.GrabFocus();
- else if( maDBButton.HasFocus() )
- maMathButton.GrabFocus();
- else if( maMathButton.HasFocus() )
- maTemplateButton.GrabFocus();
- return 1;
- }
- }
- }
return Window::Notify( rNEvt );
}
@@ -742,97 +502,33 @@ void BackingWindow::setOwningFrame( const com::sun::star::uno::Reference< com::s
void BackingWindow::Resize()
{
- Size aWindowSize( GetSizePixel() );
- Size aControlSize = maControlRect.GetSize();
- maControlRect = Rectangle( Point( (aWindowSize.Width() - aControlSize.Width()) / 2,
- (aWindowSize.Height() - aControlSize.Height()) / 2 ),
- aControlSize );
-
- maToolbox.calcMinSize();
- Size aTBSize( maToolbox.getMinSize() );
- Point aTBPos( maControlRect.Left() + mnBtnPos,
- maControlRect.Bottom() - aTBSize.Height() - 10 );
- if( Application::GetSettings().GetLayoutRTL() )
- aTBPos.X() = maControlRect.Right() - aTBSize.Width() - mnBtnPos;
- maToolbox.SetPosSizePixel( aTBPos, aTBSize );
-
- // #i93631# squeeze controls so they fit into the box
- // this can be necessary due to application font height which has small deviations
- // from the size set
- const long nBDelta = maButtonImageSize.Height() + 10;
- const long nB2Delta = 3*maButtonImageSize.Height()/2;
- const long nLastDelta = maButtonImageSize.Height();
- long nDiff = 0;
- while( ( maControlRect.Top() -
- 3 * nDiff +
- 3 * (nBDelta - nDiff) +
- (nB2Delta- nDiff) +
- nLastDelta
- ) > aTBPos.Y() )
- {
- nDiff++;
- }
-
- long nYPos = maControlRect.Top() + mnBtnTop;
-
- // Recompute column widths
- mnTextColumnWidth[0] = maWriterButton.GetTextWidth( maWriterButton.GetText() ) + maButtonImageSize.Width() + 8;
- if( mnTextColumnWidth[0] < maCalcButton.GetTextWidth( maCalcButton.GetText() ) + maButtonImageSize.Width() + 8 )
- mnTextColumnWidth[0] = maCalcButton.GetTextWidth( maCalcButton.GetText() ) + maButtonImageSize.Width() + 8;
- if( mnTextColumnWidth[0] < maImpressButton.GetTextWidth( maImpressButton.GetText() ) + maButtonImageSize.Width() + 8 )
- mnTextColumnWidth[0] = maImpressButton.GetTextWidth( maImpressButton.GetText() ) + maButtonImageSize.Width() + 8;
- if( mnTextColumnWidth[0] < maOpenButton.GetTextWidth( maOpenButton.GetText() ) + maButtonImageSize.Width() + 26 )
- mnTextColumnWidth[0] = maOpenButton.GetTextWidth( maOpenButton.GetText() ) + maButtonImageSize.Width() + 26;
-
- mnTextColumnWidth[1] = maDrawButton.GetTextWidth( maDrawButton.GetText() ) + maButtonImageSize.Width() + 8;
- if( mnTextColumnWidth[1] < maDBButton.GetTextWidth( maDBButton.GetText() ) + maButtonImageSize.Width() + 8 )
- mnTextColumnWidth[1] = maDBButton.GetTextWidth( maDBButton.GetText() ) + maButtonImageSize.Width() + 8;
- if( mnTextColumnWidth[1] < maMathButton.GetTextWidth( maMathButton.GetText() ) + maButtonImageSize.Width() + 8 )
- mnTextColumnWidth[1] = maMathButton.GetTextWidth( maMathButton.GetText() ) + maButtonImageSize.Width() + 8;
- if( mnTextColumnWidth[1] < maTemplateButton.GetTextWidth( maTemplateButton.GetText() ) + maButtonImageSize.Width() + 8 )
- mnTextColumnWidth[1] = maTemplateButton.GetTextWidth( maTemplateButton.GetText() ) + maButtonImageSize.Width() + 8;
-
- maWriterButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) );
- maDrawButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) );
- nYPos += nBDelta - nDiff;
- maCalcButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) );
- maDBButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) );
- nYPos += nBDelta - nDiff;
- maImpressButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) );
- maMathButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) );
-
- nYPos += nB2Delta - nDiff;
- maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) );
- maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) );
+ maStartCentButtons = Rectangle(
+ Point((GetOutputSizePixel().Width()-nSCWidth)/2 + nShadowTop + nPaddingTop,
+ (GetOutputSizePixel().Height()-nSCHeight)/2 + nShadowLeft + nPaddingLeft + nLogoHeight),
+ Size(nSCWidth - nShadowLeft - nShadowRight - nPaddingLeft - nPaddingRight,
+ nSCHeight - nShadowTop - nShadowBottom - nPaddingTop - nPaddingBottom - nLogoHeight));
+ if (isLayoutEnabled(this))
+ VclContainer::setLayoutAllocation(*GetWindow(WINDOW_FIRSTCHILD),
+ maStartCentButtons.TopLeft(), maStartCentButtons.GetSize());
if( !IsInPaint())
Invalidate();
}
-IMPL_LINK_NOARG(BackingWindow, ToolboxHdl)
+IMPL_LINK( BackingWindow, ExtLinkClickHdl, Button*, pButton )
{
- const char* pNodePath = NULL;
const char* pNode = NULL;
- switch( maToolbox.GetCurItemId() )
- {
- case nItemId_Extensions:
- pNodePath = "/org.openoffice.Office.Common/Help/StartCenter";
+ if( pButton == mpExtensionsButton )
pNode = "AddFeatureURL";
- break;
- case nItemId_Info:
- pNodePath = "/org.openoffice.Office.Common/Help/StartCenter";
+ else if( pButton == mpInfoButton )
pNode = "InfoURL";
- break;
- case nItemId_TplRep:
- pNodePath = "/org.openoffice.Office.Common/Help/StartCenter";
+ else if( pButton == mpTplRepButton )
pNode = "TemplateRepositoryURL";
- break;
- default:
- break;
- }
- if( pNodePath && pNode )
+
+ if( pNode )
{
+ const char* pNodePath = "/org.openoffice.Office.Common/Help/StartCenter";
try
{
Reference<lang::XMultiServiceFactory> xConfig = configuration::theDefaultProvider::get( comphelper::getProcessComponentContext() );
@@ -862,26 +558,25 @@ IMPL_LINK_NOARG(BackingWindow, ToolboxHdl)
{
}
}
-
return 0;
}
IMPL_LINK( BackingWindow, ClickHdl, Button*, pButton )
{
// dispatch the appropriate URL and end the dialog
- if( pButton == &maWriterButton )
+ if( pButton == mpWriterButton )
dispatchURL( WRITER_URL );
- else if( pButton == &maCalcButton )
+ else if( pButton == mpCalcButton )
dispatchURL( CALC_URL );
- else if( pButton == &maImpressButton )
+ else if( pButton == mpImpressButton )
dispatchURL( IMPRESS_WIZARD_URL );
- else if( pButton == &maDrawButton )
+ else if( pButton == mpDrawButton )
dispatchURL( DRAW_URL );
- else if( pButton == &maDBButton )
+ else if( pButton == mpDBButton )
dispatchURL( BASE_URL );
- else if( pButton == &maMathButton )
+ else if( pButton == mpMathButton )
dispatchURL( MATH_URL );
- else if( pButton == &maOpenButton )
+ else if( pButton == mpOpenButton )
{
Reference< XDispatchProvider > xFrame( mxFrame, UNO_QUERY );
@@ -892,7 +587,7 @@ IMPL_LINK( BackingWindow, ClickHdl, Button*, pButton )
dispatchURL( OPEN_URL, OUString(), xFrame, aArgs );
}
- else if( pButton == &maTemplateButton )
+ else if( pButton == mpTemplateButton )
{
Reference< XDispatchProvider > xFrame( mxFrame, UNO_QUERY );
@@ -906,12 +601,14 @@ IMPL_LINK( BackingWindow, ClickHdl, Button*, pButton )
return 0;
}
+/*
IMPL_LINK( BackingWindow, ActivateHdl, Button*, pButton )
{
- if( pButton == &maOpenButton )
+ if( pButton == mpOpenButton )
prepareRecentFileMenu();
return 0;
}
+*/
struct ImplDelayedDispatch
{
@@ -991,4 +688,12 @@ void BackingWindow::dispatchURL( const OUString& i_rURL,
}
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+Size BackingWindow::GetOptimalSize() const
+{
+ if (isLayoutEnabled(this))
+ return VclContainer::getLayoutRequisition(*GetWindow(WINDOW_FIRSTCHILD));
+
+ return Window::GetOptimalSize();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab:*/
diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx
index ab45314..d52a8cb 100644
--- a/framework/source/services/backingwindow.hxx
+++ b/framework/source/services/backingwindow.hxx
@@ -22,11 +22,13 @@
#include "rtl/ustring.hxx"
+#include "vcl/builder.hxx"
#include "vcl/button.hxx"
#include "vcl/menubtn.hxx"
#include "vcl/fixed.hxx"
#include "vcl/bitmapex.hxx"
#include "vcl/toolbox.hxx"
+#include "vcl/layout.hxx"
#include "unotools/moduleoptions.hxx"
#include "svtools/acceleratorexecute.hxx"
@@ -54,24 +56,7 @@ class MnemonicGenerator;
namespace framework
{
- // To get the transparent mouse-over look, the closer is actually a toolbox
- // overload DataChange to handle style changes correctly
- class DecoToolBox : public ToolBox
- {
- Size maMinSize;
-
- using Window::ImplInit;
- public:
- DecoToolBox( Window* pParent, WinBits nStyle = 0 );
- DecoToolBox( Window* pParent, const ResId& rResId );
-
- void DataChanged( const DataChangedEvent& rDCEvt );
-
- void calcMinSize();
- Size getMinSize();
- };
-
- class BackingWindow : public Window
+ class BackingWindow : public Window, public VclBuilderContainer
{
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext;
com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider > mxDesktopDispatchProvider;
@@ -80,16 +65,22 @@ namespace framework
com::sun::star::uno::Reference< com::sun::star::frame::XPopupMenuController > mxPopupMenuController;
com::sun::star::uno::Reference< com::sun::star::awt::XPopupMenu > mxPopupMenu;
- ImageButton maWriterButton;
- ImageButton maCalcButton;
- ImageButton maImpressButton;
- MenuButton maOpenButton;
- ImageButton maDrawButton;
- ImageButton maDBButton;
- ImageButton maMathButton;
- ImageButton maTemplateButton;
+ PushButton* mpWriterButton;
+ PushButton* mpCalcButton;
+ PushButton* mpImpressButton;
+ //MenuButton* mpOpenButton;
+ PushButton* mpOpenButton;
+ PushButton* mpDrawButton;
+ PushButton* mpDBButton;
+ PushButton* mpMathButton;
+ PushButton* mpTemplateButton;
+
- DecoToolBox maToolbox;
+ PushButton* mpExtensionsButton;
+ PushButton* mpInfoButton;
+ PushButton* mpTplRepButton;
+
+ VclGrid* mpStartCenterContainer;
BitmapEx maBackgroundLeft;
BitmapEx maBackgroundMiddle;
@@ -102,35 +93,44 @@ namespace framework
Font maTextFont;
Rectangle maControlRect;
- long mnColumnWidth[2];
- long mnTextColumnWidth[2];
+ Rectangle maStartCentButtons;
+
Color maLabelTextColor;
- Size maButtonImageSize;
bool mbInitControls;
sal_Int32 mnHideExternalLinks;
svt::AcceleratorExecute* mpAccExec;
- long mnBtnPos;
- long mnBtnTop;
static const int nItemId_Extensions = 1;
static const int nItemId_Info = 3;
static const int nItemId_TplRep = 4;
+
static const int nShadowTop = 30;
static const int nShadowLeft = 30;
static const int nShadowRight = 30;
static const int nShadowBottom = 30;
+ static const int nPaddingTop = 30;
+ static const int nPaddingLeft = 50;
+ static const int nPaddingRight = 50;
+ static const int nPaddingBottom = 30;
+
+ static const int nLogoHeight = 150;
+ int nSCWidth;
+ int nSCHeight;
+
void loadImage( const ResId& i_rId, PushButton& i_rButton );
- void layoutButton( const char* i_pURL, int nColumn, int i_nExtraWidth, const std::set<OUString>& i_rURLS,
+ void layoutButton( const char* i_pURL, const std::set<OUString>& i_rURLS,
SvtModuleOptions& i_rOpt, SvtModuleOptions::EModule i_eMod,
PushButton& i_rBtn,
MnemonicGenerator& i_rMnemonicGen,
const String& i_rStr = String()
);
+ void layoutExternalLink( PushButton& i_rBtn );
+
void dispatchURL( const OUString& i_rURL,
const OUString& i_rTarget = OUString( "_default" ),
const com::sun::star::uno::Reference< com::sun::star::frame::XDispatchProvider >& i_xProv = com::sun::star::uno::Reference< com::sun::star::frame::XDispatchProvider >(),
@@ -138,13 +138,13 @@ namespace framework
);
DECL_LINK( ClickHdl, Button* );
- DECL_LINK( ActivateHdl, Button* );
- DECL_LINK( ToolboxHdl, void* );
+ DECL_LINK( ExtLinkClickHdl, Button* );
+ //DECL_LINK( ActivateHdl, Button* );
DECL_LINK( WindowEventListener, VclSimpleEvent* );
void initControls();
void initBackground();
- void prepareRecentFileMenu();
+ //void prepareRecentFileMenu();
public:
BackingWindow( Window* pParent );
~BackingWindow();
@@ -154,6 +154,8 @@ namespace framework
virtual long Notify( NotifyEvent& rNEvt );
virtual void GetFocus();
+ virtual Size GetOptimalSize() const;
+
void setOwningFrame( const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& xFrame );
};
diff --git a/framework/uiconfig/startmodule/ui/startcenter.ui b/framework/uiconfig/startmodule/ui/startcenter.ui
new file mode 100644
index 0000000..067c4d5
--- /dev/null
+++ b/framework/uiconfig/startmodule/ui/startcenter.ui
@@ -0,0 +1,280 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkImage" id="add_temp_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">framework/res/addtemplate_32.png</property>
+ </object>
+ <object class="GtkImage" id="calc_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/ods_32_8.png</property>
+ </object>
+ <object class="GtkImage" id="database_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/odb_32_8.png</property>
+ </object>
+ <object class="GtkImage" id="draw_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/odg_32_8.png</property>
+ </object>
+ <object class="GtkImage" id="extension_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">framework/res/extension.png</property>
+ </object>
+ <object class="GtkImage" id="impress_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/odp_32_8.png</property>
+ </object>
+ <object class="GtkImage" id="info_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">framework/res/info_26.png</property>
+ </object>
+ <object class="GtkImage" id="math_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">res/odf_32_8.png</property>
+ </object>
+ <object class="GtkImage" id="open_image">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="pixbuf">framework/res/folder_32.png</property>
+ </object>
+ <object class="GtkBox" id="StartCenter">
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkGrid" id="sccontainer">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="column_homogeneous">True</property>
+ <child>
+ <object class="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="column_homogeneous">True</property>
+ <child>
+ <object class="GtkButton" id="writer">
+ <property name="label" translatable="yes">Text Document</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">writer_image</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ </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>
+ <child>
+ <object class="GtkButton" id="draw">
+ <property name="label" translatable="yes">Drawing</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="image">draw_image</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="calc">
+ <property name="label" translatable="yes">Spreadsheet</property>
+ <property name="visible">True</property>
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list