summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2010-03-30 13:51:42 +0200
committerVladimir Glazunov <vg@openoffice.org>2010-03-30 13:51:42 +0200
commit7020d9c547a37133aefbbbe34d132d6402104279 (patch)
treea72f2ba758bb038a5b1fb2ab22a2741d62d635d6 /framework
parent54da565767b0bb09e9e17ba9de0eb1d16082a547 (diff)
native0: #161767# OOo rebranding - transplanted from 26f86bb16da0@native0
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/framework.hrc8
-rw-r--r--framework/source/services/backingwindow.cxx149
-rw-r--r--framework/source/services/backingwindow.hxx6
-rw-r--r--framework/source/services/fwk_services.src56
4 files changed, 81 insertions, 138 deletions
diff --git a/framework/inc/framework.hrc b/framework/inc/framework.hrc
index a8a0f3fdd390..e49192aa7c33 100644
--- a/framework/inc/framework.hrc
+++ b/framework/inc/framework.hrc
@@ -59,13 +59,9 @@
#define BMP_BACKING_FORMULA 11
#define BMP_BACKING_OPENFILE 12
#define BMP_BACKING_OPENTEMPLATE 13
-#define BMP_BACKING_EXT 14
#define STR_BACKING_EXTHELP 15
-#define BMP_BACKING_REG 16
#define STR_BACKING_REGHELP 17
-#define BMP_BACKING_INFO 18
#define STR_BACKING_INFOHELP 19
-#define BMP_BACKING_TPLREP 20
#define STR_BACKING_TPLREP 21
#define BMP_BACKING_FOLDER 22
@@ -77,6 +73,10 @@
#define BMP_BACKING_BACKGROUND_RIGHT 3
#define BMP_BACKING_BACKGROUND_RTL_LEFT 4
#define BMP_BACKING_BACKGROUND_RTL_RIGHT 5
+#define BMP_BACKING_EXT 6
+#define BMP_BACKING_REG 7
+#define BMP_BACKING_INFO 8
+#define BMP_BACKING_TPLREP 9
// Ids of TabWindow
#define WIN_TABWINDOW (RID_FWK_DIALOG_START+101)
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index 511edd6fb6cb..bbbefdbdbda1 100644
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -116,13 +116,14 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
Window( i_pParent, FwkResId( DLG_BACKING ) ),
maWelcome( this, WB_LEFT ),
maProduct( this, WB_LEFT ),
- maCreateText( this, WB_LEFT ),
maWriterText( this, WB_WORDBREAK | WB_VCENTER ),
maWriterButton( this, STC_BUTTON_STYLE ),
maCalcText( this, WB_WORDBREAK | WB_VCENTER ),
maCalcButton( this, STC_BUTTON_STYLE ),
maImpressText( this, WB_WORDBREAK | WB_VCENTER ),
maImpressButton( this, STC_BUTTON_STYLE ),
+ maOpenText( this, WB_WORDBREAK | WB_VCENTER ),
+ maOpenButton( this, STC_BUTTON_STYLE ),
maDrawText( this, WB_WORDBREAK | WB_VCENTER ),
maDrawButton( this, STC_BUTTON_STYLE ),
maDBText( this, WB_WORDBREAK | WB_VCENTER ),
@@ -131,19 +132,16 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
maMathButton( this, STC_BUTTON_STYLE ),
maTemplateText( this, WB_WORDBREAK | WB_VCENTER ),
maTemplateButton( this, STC_BUTTON_STYLE ),
- maOpenText( this, WB_WORDBREAK | WB_VCENTER ),
- maOpenButton( this, STC_BUTTON_STYLE ),
maToolbox( this, WB_DIALOGCONTROL ),
maWelcomeString( FwkResId( STR_BACKING_WELCOME ) ),
maProductString( FwkResId( STR_BACKING_WELCOMEPRODUCT ) ),
- maCreateString( FwkResId( STR_BACKING_CREATE ) ),
maOpenString( FwkResId( STR_BACKING_FILE ) ),
maTemplateString( FwkResId( STR_BACKING_TEMPLATE ) ),
maButtonImageSize( 10, 10 ),
mbInitControls( false ),
mnLayoutStyle( 0 ),
mpAccExec( NULL ),
- mnBtnPos( 240 )
+ mnBtnPos( 120 )
{
mnColumnWidth[0] = mnColumnWidth[1] = 0;
mnTextColumnWidth[0] = mnTextColumnWidth[1] = 0;
@@ -180,24 +178,12 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
loadImage( FwkResId( BMP_BACKING_DRAW ), maDrawButton );
loadImage( FwkResId( BMP_BACKING_DATABASE ), maDBButton );
loadImage( FwkResId( BMP_BACKING_FORMULA ), maMathButton );
- if( mnLayoutStyle == 1 )
- {
- loadImage( FwkResId( BMP_BACKING_FOLDER ), maOpenButton );
- loadImage( FwkResId( BMP_BACKING_FOLDER ), maTemplateButton );
- }
- else
- {
- loadImage( FwkResId( BMP_BACKING_OPENFILE ), maOpenButton );
- loadImage( FwkResId( BMP_BACKING_OPENTEMPLATE ), maTemplateButton );
- }
+ loadImage( FwkResId( BMP_BACKING_FOLDER ), maOpenButton );
+ loadImage( FwkResId( BMP_BACKING_FOLDER ), maTemplateButton );
- BitmapEx aExtImage( FwkResId( BMP_BACKING_EXT ) );
String aExtHelpText( FwkResId( STR_BACKING_EXTHELP ) );
- BitmapEx aRegImage( FwkResId( BMP_BACKING_REG ) );
String aRegHelpText( FwkResId( STR_BACKING_REGHELP ) );
- BitmapEx aInfoImage( FwkResId( BMP_BACKING_INFO ) );
String aInfoHelpText( FwkResId( STR_BACKING_INFOHELP ) );
- BitmapEx aTplRepImage( FwkResId( BMP_BACKING_TPLREP ) );
String aTplRepHelpText( FwkResId( STR_BACKING_TPLREP ) );
// clean up resource stack
@@ -217,25 +203,25 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
maToolbox.SetStyle( maToolbox.GetStyle() | WB_FORCETABCYCLE );
// insert toolbox items
- maToolbox.InsertItem( nItemId_TplRep, Image( aTplRepImage ) );
+ maToolbox.InsertItem( nItemId_TplRep, Image() );
maToolbox.SetItemText( nItemId_TplRep, aTplRepHelpText );
maToolbox.SetQuickHelpText( nItemId_TplRep, aTplRepHelpText );
maToolbox.SetItemCommand( nItemId_TplRep, String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:TemplateRepository" ) ) );
maToolbox.ShowItem( nItemId_TplRep );
- maToolbox.InsertItem( nItemId_Extensions, Image( aExtImage ) );
+ maToolbox.InsertItem( nItemId_Extensions, Image() );
maToolbox.SetQuickHelpText( nItemId_Extensions, aExtHelpText );
maToolbox.SetItemText( nItemId_Extensions, aExtHelpText );
maToolbox.SetItemCommand( nItemId_Extensions, String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:Extensions" ) ) );
maToolbox.ShowItem( nItemId_Extensions );
- maToolbox.InsertItem( nItemId_Reg, Image( aRegImage ) );
+ maToolbox.InsertItem( nItemId_Reg, Image() );
maToolbox.SetQuickHelpText( nItemId_Reg, aRegHelpText );
maToolbox.SetItemText( nItemId_Reg, aRegHelpText );
maToolbox.SetItemCommand( nItemId_Reg, String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:Register" ) ) );
maToolbox.ShowItem( nItemId_Reg );
- maToolbox.InsertItem( nItemId_Info, Image( aInfoImage ) );
+ maToolbox.InsertItem( nItemId_Info, Image() );
maToolbox.SetItemText( nItemId_Info, aInfoHelpText );
maToolbox.SetQuickHelpText( nItemId_Info, aInfoHelpText );
maToolbox.SetItemCommand( nItemId_Info, String( RTL_CONSTASCII_USTRINGPARAM( ".HelpId:StartCenter:Info" ) ) );
@@ -329,13 +315,15 @@ void BackingWindow::initBackground()
maBackgroundLeft = BitmapEx( FwkResId( BMP_BACKING_BACKGROUND_LEFT ) );
maBackgroundRight = BitmapEx( FwkResId( BMP_BACKING_BACKGROUND_RIGHT ) );
}
+ 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 ) ) );
maWelcome.SetControlForeground( maWelcomeTextColor );
maWelcome.SetBackground();
maProduct.SetControlForeground( maWelcomeTextColor );
maProduct.SetBackground();
- maCreateText.SetControlForeground( maLabelTextColor );
- maCreateText.SetControlBackground( aTextBGColor );
maWriterText.SetControlForeground( maLabelTextColor );
maWriterText.SetControlBackground( aTextBGColor );
maCalcText.SetControlForeground( maLabelTextColor );
@@ -398,8 +386,6 @@ void BackingWindow::initControls()
if( maControlRect.GetWidth() < mnBtnPos + maWelcomeSize.Width() + 20 )
maControlRect.Right() = maControlRect.Left() + maWelcomeSize.Width() + mnBtnPos + 20;
- maWelcome.Show();
-
nYPos += maWelcomeSize.Height();
// set product string
@@ -419,7 +405,11 @@ void BackingWindow::initControls()
if( maControlRect.GetWidth() < maProductSize.Width() + mnBtnPos + 10 )
maControlRect.Right() = maControlRect.Left() + maProductSize.Width() + mnBtnPos + 10;
- maProduct.Show();
+ if( mnLayoutStyle == 1 )
+ {
+ maWelcome.Show();
+ maProduct.Show();
+ }
nYPos += (maProductSize.Height()*3)/2;
@@ -427,17 +417,6 @@ void BackingWindow::initControls()
maTextFont.SetSize( Size( 0, 11 ) );
maTextFont.SetWeight( WEIGHT_NORMAL );
- if( mnLayoutStyle == 0 )
- {
- maCreateText.SetText( maCreateString );
- maCreateText.SetFont( maTextFont );
- maCreateText.SetControlFont( maTextFont );
- maCreateSize = Size( maCreateText.GetTextWidth( maCreateString ), maCreateText.GetTextHeight() );
- maCreateText.Show();
-
- nYPos += (maCreateSize.Height()*3)/2;
- }
-
// collect the URLs of the entries in the File/New menu
SvtModuleOptions aModuleOptions;
std::set< rtl::OUString > aFileNewAppsAvailable;
@@ -500,31 +479,13 @@ void BackingWindow::initControls()
nYPos += 3*maButtonImageSize.Height() / 2;
- if( mnLayoutStyle == 0 )
- {
- layoutButtonAndText( NULL, -1, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SWRITER,
- maTemplateButton, maTemplateText, aMnemns, maTemplateString );
-
- nYPos += 10;
- layoutButtonAndText( NULL, -1, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SWRITER,
- maOpenButton, maOpenText, aMnemns, maOpenString );
- nYPos += 10;
-
- // change taborder to reflect changed positions
- maOpenButton.SetZOrder( &maDrawButton, WINDOW_ZORDER_BEFOR );
- }
- else
- {
- layoutButtonAndText( NULL, 0, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SWRITER,
- maOpenButton, maOpenText, aMnemns, maOpenString );
- layoutButtonAndText( NULL, 1, aFileNewAppsAvailable,
- aModuleOptions, SvtModuleOptions::E_SWRITER,
- maTemplateButton, maTemplateText, aMnemns, maTemplateString );
- nYPos += 10;
- }
+ layoutButtonAndText( NULL, 0, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SWRITER,
+ maOpenButton, maOpenText, aMnemns, maOpenString );
+ layoutButtonAndText( NULL, 1, aFileNewAppsAvailable,
+ aModuleOptions, SvtModuleOptions::E_SWRITER,
+ maTemplateButton, maTemplateText, aMnemns, maTemplateString );
+ nYPos += 10;
DBG_ASSERT( nYPos < maControlRect.GetHeight(), "misformatting !" );
if( mnColumnWidth[0] + mnColumnWidth[1] + mnBtnPos + 20 > maControlRect.GetWidth() )
@@ -533,30 +494,22 @@ void BackingWindow::initControls()
mnTextColumnWidth[0] = mnColumnWidth[0];
mnTextColumnWidth[1] = mnColumnWidth[1];
- if( mnLayoutStyle == 1 )
+ if( mnTextColumnWidth[1] > mnTextColumnWidth[0] )
{
- 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;
- }
+ mnColumnWidth[0] = mnColumnWidth[1];
+ mnTextColumnWidth[0] = mnTextColumnWidth[1];
}
else
{
- mnColumnWidth[0] += 30;
- mnColumnWidth[1] += 30;
+ 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 ) );
@@ -705,8 +658,10 @@ void BackingWindow::Resize()
maToolbox.calcMinSize();
Size aTBSize( maToolbox.getMinSize() );
- Point aTBPos( maControlRect.Right() - aTBSize.Width() - 10,
+ 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
@@ -715,7 +670,6 @@ void BackingWindow::Resize()
const long nWDelta = maWelcomeSize.Height();
const long nW2Delta = (maWelcomeSize.Height()*3)/2;
const long nPDelta = (maProductSize.Height()*3)/2;
- const long nCDelta = (maCreateSize.Height()*3)/2;
const long nBDelta = maButtonImageSize.Height() + 10;
const long nB2Delta = 3*maButtonImageSize.Height()/2;
const long nLastDelta = maButtonImageSize.Height();
@@ -724,7 +678,6 @@ void BackingWindow::Resize()
(nWDelta - nDiff) +
(nW2Delta- nDiff) +
(nPDelta - nDiff) +
- (nCDelta - nDiff) +
3 * (nBDelta - nDiff) +
(nB2Delta- nDiff) +
nLastDelta
@@ -741,13 +694,7 @@ void BackingWindow::Resize()
maProduct.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( maControlRect.GetWidth() - mnBtnPos - 5, (maProductSize.Height()*20)/19 ) );
nYPos += nPDelta - nDiff;
- maCreateText.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ),
- Size( maControlRect.GetWidth() - mnBtnPos - 5, maCreateSize.Height() ) );
-
- if( mnLayoutStyle == 0 )
- nYPos += nCDelta - nDiff;
- else
- nYPos += nWDelta/2 - nDiff;
+ nYPos += nWDelta/2 - nDiff;
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() ) );
@@ -759,18 +706,8 @@ void BackingWindow::Resize()
maMathButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos + mnColumnWidth[0], nYPos ), Size( mnTextColumnWidth[1], maButtonImageSize.Height() ) );
nYPos += nB2Delta - nDiff;
- if( mnLayoutStyle == 0 )
- {
- maTemplateButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) );
- nYPos += nBDelta - nDiff;
- maOpenButton.SetPosSizePixel( Point( maControlRect.Left() + mnBtnPos, nYPos ), Size( mnTextColumnWidth[0], maButtonImageSize.Height() ) );
- nYPos += nBDelta - nDiff;
- }
- else
- {
- 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() ) );
- }
+ 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() ) );
}
IMPL_LINK( BackingWindow, ToolboxHdl, void*, EMPTYARG )
diff --git a/framework/source/services/backingwindow.hxx b/framework/source/services/backingwindow.hxx
index 67a4fd67a636..7b7dfa34b110 100644
--- a/framework/source/services/backingwindow.hxx
+++ b/framework/source/services/backingwindow.hxx
@@ -86,14 +86,14 @@ namespace framework
Size maWelcomeSize;
FixedText maProduct;
Size maProductSize;
- FixedText maCreateText;
- Size maCreateSize;
FixedText maWriterText;
ImageButton maWriterButton;
FixedText maCalcText;
ImageButton maCalcButton;
FixedText maImpressText;
ImageButton maImpressButton;
+ FixedText maOpenText;
+ ImageButton maOpenButton;
FixedText maDrawText;
ImageButton maDrawButton;
FixedText maDBText;
@@ -102,8 +102,6 @@ namespace framework
ImageButton maMathButton;
FixedText maTemplateText;
ImageButton maTemplateButton;
- FixedText maOpenText;
- ImageButton maOpenButton;
DecoToolBox maToolbox;
diff --git a/framework/source/services/fwk_services.src b/framework/source/services/fwk_services.src
index 3d6710fec872..7e2ee3253e71 100644
--- a/framework/source/services/fwk_services.src
+++ b/framework/source/services/fwk_services.src
@@ -77,46 +77,22 @@ Window DLG_BACKING
{
File = "odf_32.png";
};
- Bitmap BMP_BACKING_OPENFILE
- {
- File = "open_32.png";
- };
- Bitmap BMP_BACKING_OPENTEMPLATE
- {
- File = "template_32.png";
- };
Bitmap BMP_BACKING_FOLDER
{
File = "folder_32.png";
};
- Bitmap BMP_BACKING_EXT
- {
- File = "extension_plus_26.png";
- };
String STR_BACKING_EXTHELP
{
Text [ en-US ] = "Add new features to %PRODUCTNAME";
};
- Bitmap BMP_BACKING_REG
- {
- File = "register_32.png";
- };
String STR_BACKING_REGHELP
{
Text [ en-US ] = "Register your %PRODUCTNAME";
};
- Bitmap BMP_BACKING_INFO
- {
- File = "info_26.png";
- };
String STR_BACKING_INFOHELP
{
Text [ en-US ] = "Get more information about %PRODUCTNAME";
};
- Bitmap BMP_BACKING_TPLREP
- {
- File = "addtemplate_32.png";
- };
String STR_BACKING_TPLREP
{
Text [ en-US ] = "Get more templates for %PRODUCTNAME";
@@ -145,6 +121,22 @@ Resource RES_BACKING_IMAGES
{
File = "backing_rtl_right.png";
};
+ Bitmap BMP_BACKING_EXT
+ {
+ File = "extension.png";
+ };
+ Bitmap BMP_BACKING_REG
+ {
+ File = "register_32.png";
+ };
+ Bitmap BMP_BACKING_INFO
+ {
+ File = "info_26.png";
+ };
+ Bitmap BMP_BACKING_TPLREP
+ {
+ File = "addtemplate_32.png";
+ };
};
Resource RES_BACKING_IMAGES_HC
@@ -169,6 +161,22 @@ Resource RES_BACKING_IMAGES_HC
{
File = "backing_rtl_right_hc.png";
};
+ Bitmap BMP_BACKING_EXT
+ {
+ File = "extension_hc.png";
+ };
+ Bitmap BMP_BACKING_REG
+ {
+ File = "register_hc.png";
+ };
+ Bitmap BMP_BACKING_INFO
+ {
+ File = "info_hc.png";
+ };
+ Bitmap BMP_BACKING_TPLREP
+ {
+ File = "template_hc.png";
+ };
};
Window WIN_TABWINDOW