summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/decoview.cxx33
-rw-r--r--vcl/source/window/dlgctrl.cxx64
-rw-r--r--vcl/source/window/introwin.cxx9
-rw-r--r--vcl/source/window/mnemonic.cxx68
-rw-r--r--vcl/source/window/printdlg.cxx149
-rw-r--r--vcl/source/window/status.cxx104
-rw-r--r--vcl/source/window/tabdlg.cxx17
-rw-r--r--vcl/source/window/window.cxx9
-rw-r--r--vcl/source/window/window3.cxx6
-rw-r--r--vcl/source/window/winproc.cxx5
10 files changed, 341 insertions, 123 deletions
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index 03675ccf69ca..a32790cfb0d4 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -1353,3 +1353,36 @@ Rectangle DecorationView::DrawButton( const Rectangle& rRect, USHORT nStyle )
return aRect;
}
+
+// -----------------------------------------------------------------------
+
+void DecorationView::DrawSeparator( const Point& rStart, const Point& rStop, bool bVertical )
+{
+ Point aStart( rStart ), aStop( rStop );
+ const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings();
+
+ mpOutDev->Push( PUSH_LINECOLOR );
+ if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
+ mpOutDev->SetLineColor( Color( COL_BLACK ) );
+ else
+ mpOutDev->SetLineColor( rStyleSettings.GetShadowColor() );
+
+ mpOutDev->DrawLine( aStart, aStop );
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
+ {
+ mpOutDev->SetLineColor( rStyleSettings.GetLightColor() );
+ if( bVertical )
+ {
+ aStart.X()++;
+ aStop.X()++;
+ }
+ else
+ {
+ aStart.Y()++;
+ aStop.Y()++;
+ }
+ mpOutDev->DrawLine( aStart, aStop );
+ }
+ mpOutDev->Pop();
+}
+
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index daa26e2c7782..64f2b7e0d2a1 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -886,20 +886,6 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput )
return TRUE;
}
- // if we have come here (and therefore the strange "formular" logic above
- // turned up no result, then let's try to find a customer for Ctrl-TAB
- if ( nKeyCode == KEY_TAB && aKeyCode.IsMod1() && ! aKeyCode.IsMod2() )
- {
- TabDialog* pDlg = dynamic_cast<TabDialog*>(this);
- if( pDlg )
- {
- TabControl* pTabCtrl = pDlg->ImplGetFirstTabControl();
- NotifyEvent aEvt( bKeyInput ? EVENT_KEYINPUT : EVENT_KEYUP,
- pTabCtrl, &rKEvt );
- return pTabCtrl->ImplHandleNotifyEvent( aEvt );
- }
- }
-
return FALSE;
}
@@ -1093,10 +1079,15 @@ Window* Window::GetLabelFor() const
return pWindow;
sal_Unicode nAccel = getAccel( GetText() );
- if( GetType() == WINDOW_FIXEDTEXT ||
- GetType() == WINDOW_FIXEDLINE ||
- GetType() == WINDOW_GROUPBOX )
+
+ WindowType nMyType = GetType();
+ if( nMyType == WINDOW_FIXEDTEXT ||
+ nMyType == WINDOW_FIXEDLINE ||
+ nMyType == WINDOW_GROUPBOX )
{
+ // #i100833# MT 2010/02: Group box and fixed lines can also lable a fixed text.
+ // See tools/options/print for example.
+ BOOL bThisIsAGroupControl = (nMyType == WINDOW_GROUPBOX) || (nMyType == WINDOW_FIXEDLINE);
Window* pSWindow = NULL;
// get index, form start and form end
USHORT nIndex=0, nFormStart=0, nFormEnd=0;
@@ -1128,9 +1119,14 @@ Window* Window::GetLabelFor() const
FALSE );
if( pSWindow && pSWindow->IsVisible() && ! (pSWindow->GetStyle() & WB_NOLABEL) )
{
- if( pSWindow->GetType() != WINDOW_FIXEDTEXT &&
- pSWindow->GetType() != WINDOW_FIXEDLINE &&
- pSWindow->GetType() != WINDOW_GROUPBOX )
+ WindowType nType = pSWindow->GetType();
+ if( nType != WINDOW_FIXEDTEXT &&
+ nType != WINDOW_FIXEDLINE &&
+ nType != WINDOW_GROUPBOX )
+ {
+ pWindow = pSWindow;
+ }
+ else if( bThisIsAGroupControl && ( nType == WINDOW_FIXEDTEXT ) )
{
pWindow = pSWindow;
}
@@ -1163,9 +1159,13 @@ Window* Window::GetLabeledBy() const
if( GetType() == WINDOW_CHECKBOX || GetType() == WINDOW_RADIOBUTTON )
return NULL;
- if( ! ( GetType() == WINDOW_FIXEDTEXT ||
- GetType() == WINDOW_FIXEDLINE ||
- GetType() == WINDOW_GROUPBOX ) )
+// if( ! ( GetType() == WINDOW_FIXEDTEXT ||
+// GetType() == WINDOW_FIXEDLINE ||
+// GetType() == WINDOW_GROUPBOX ) )
+ // #i100833# MT 2010/02: Group box and fixed lines can also lable a fixed text.
+ // See tools/options/print for example.
+ WindowType nMyType = GetType();
+ if ( (nMyType != WINDOW_GROUPBOX) && (nMyType != WINDOW_FIXEDLINE) )
{
// search for a control that labels this window
// a label is considered the last fixed text, fixed line or group box
@@ -1196,14 +1196,18 @@ Window* Window::GetLabeledBy() const
nSearchIndex,
nFoundIndex,
FALSE );
- if( pSWindow && pSWindow->IsVisible() &&
- ! (pSWindow->GetStyle() & WB_NOLABEL) &&
- ( pSWindow->GetType() == WINDOW_FIXEDTEXT ||
- pSWindow->GetType() == WINDOW_FIXEDLINE ||
- pSWindow->GetType() == WINDOW_GROUPBOX ) )
+ if( pSWindow && pSWindow->IsVisible() && !(pSWindow->GetStyle() & WB_NOLABEL) )
{
- pWindow = pSWindow;
- break;
+ WindowType nType = pSWindow->GetType();
+ if ( ( nType == WINDOW_FIXEDTEXT ||
+ nType == WINDOW_FIXEDLINE ||
+ nType == WINDOW_GROUPBOX ) )
+ {
+ // a fixed text can't be labeld by a fixed text.
+ if ( ( nMyType != WINDOW_FIXEDTEXT ) || ( nType != WINDOW_FIXEDTEXT ) )
+ pWindow = pSWindow;
+ break;
+ }
}
if( nFoundIndex > nSearchIndex || nSearchIndex == 0 )
break;
diff --git a/vcl/source/window/introwin.cxx b/vcl/source/window/introwin.cxx
index 02ccc2282a42..03f88adc3566 100644
--- a/vcl/source/window/introwin.cxx
+++ b/vcl/source/window/introwin.cxx
@@ -77,3 +77,12 @@ void IntroWindow::SetBackgroundBitmap( const Bitmap& rBitmap )
ImplGetFrame()->SetBackgroundBitmap( pBmp );
}
}
+
+void IntroWindow::SetBackgroundBitmap( const BitmapEx& rBitmapEx )
+{
+ if( ! rBitmapEx.IsEmpty() )
+ {
+ SalBitmap* pBmp = rBitmapEx.ImplGetBitmapImpBitmap()->ImplGetSalBitmap();
+ ImplGetFrame()->SetBackgroundBitmap( pBmp );
+ }
+}
diff --git a/vcl/source/window/mnemonic.cxx b/vcl/source/window/mnemonic.cxx
index 74926ad3de4b..c2c6c18135f2 100644
--- a/vcl/source/window/mnemonic.cxx
+++ b/vcl/source/window/mnemonic.cxx
@@ -332,39 +332,41 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey )
}
}
- if( ! bChanged )
- {
- /*
- * #97809# if all else fails use the first character of a word
- * anyway and live with duplicate mnemonics
- */
- nIndex = 0;
- do
- {
- c = aKey.GetChar( nIndex );
-
- nMnemonicIndex = ImplGetMnemonicIndex( c );
- if ( nMnemonicIndex != MNEMONIC_INDEX_NOTFOUND )
- {
- maMnemonics[nMnemonicIndex] = 0;
- rKey.Insert( MNEMONIC_CHAR, nIndex );
- bChanged = TRUE;
- break;
- }
-
- // Search for next word
- do
- {
- nIndex++;
- c = aKey.GetChar( nIndex );
- if ( c == ' ' )
- break;
- }
- while ( nIndex < nLen );
- nIndex++;
- }
- while ( nIndex < nLen );
- }
+// #i87415# Duplicates mnemonics are bad for consistent keyboard accessibility
+// It's probably better to not have mnemonics for some widgets, than to have ambiguous ones.
+// if( ! bChanged )
+// {
+// /*
+// * #97809# if all else fails use the first character of a word
+// * anyway and live with duplicate mnemonics
+// */
+// nIndex = 0;
+// do
+// {
+// c = aKey.GetChar( nIndex );
+//
+// nMnemonicIndex = ImplGetMnemonicIndex( c );
+// if ( nMnemonicIndex != MNEMONIC_INDEX_NOTFOUND )
+// {
+// maMnemonics[nMnemonicIndex] = 0;
+// rKey.Insert( MNEMONIC_CHAR, nIndex );
+// bChanged = TRUE;
+// break;
+// }
+//
+// // Search for next word
+// do
+// {
+// nIndex++;
+// c = aKey.GetChar( nIndex );
+// if ( c == ' ' )
+// break;
+// }
+// while ( nIndex < nLen );
+// nIndex++;
+// }
+// while ( nIndex < nLen );
+// }
return bChanged;
}
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index caf5705cbcd9..35077b1cff0e 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -42,16 +42,22 @@
#include "vcl/help.hxx"
#include "vcl/decoview.hxx"
#include "vcl/svapp.hxx"
+#include "vcl/unohelp.hxx"
#include "unotools/localedatawrapper.hxx"
#include "rtl/ustrbuf.hxx"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/container/XNameAccess.hpp"
+#include "com/sun/star/beans/PropertyValue.hpp"
#include "com/sun/star/awt/Size.hpp"
using namespace vcl;
using namespace com::sun::star;
using namespace com::sun::star::uno;
+using namespace com::sun::star::lang;
+using namespace com::sun::star::container;
using namespace com::sun::star::beans;
#define HELPID_PREFIX ".HelpId:vcl:PrintDialog"
@@ -66,7 +72,7 @@ PrintDialog::PrintPreviewWindow::PrintPreviewWindow( Window* i_pParent, const Re
{
SetPaintTransparent( TRUE );
SetBackground();
- if( GetSettings().GetStyleSettings().GetHighContrastMode() )
+ if( useHCColorReplacement() )
maPageVDev.SetBackground( GetSettings().GetStyleSettings().GetWindowColor() );
else
maPageVDev.SetBackground( Color( COL_WHITE ) );
@@ -76,12 +82,76 @@ PrintDialog::PrintPreviewWindow::~PrintPreviewWindow()
{
}
+bool PrintDialog::PrintPreviewWindow::useHCColorReplacement() const
+{
+ bool bRet = false;
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
+ {
+ try
+ {
+ // get service provider
+ Reference< XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() );
+ // create configuration hierachical access name
+ if( xSMgr.is() )
+ {
+ try
+ {
+ Reference< XMultiServiceFactory > xConfigProvider(
+ Reference< XMultiServiceFactory >(
+ xSMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider" ))),
+ UNO_QUERY )
+ );
+ if( xConfigProvider.is() )
+ {
+ Sequence< Any > aArgs(1);
+ PropertyValue aVal;
+ aVal.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
+ aVal.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/Accessibility" ) );
+ aArgs.getArray()[0] <<= aVal;
+ Reference< XNameAccess > xConfigAccess(
+ Reference< XNameAccess >(
+ xConfigProvider->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationAccess" )),
+ aArgs ),
+ UNO_QUERY )
+ );
+ if( xConfigAccess.is() )
+ {
+ try
+ {
+ sal_Bool bValue = sal_False;
+ Any aAny = xConfigAccess->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsForPagePreviews" ) ) );
+ if( aAny >>= bValue )
+ bRet = bool(bValue);
+ }
+ catch( NoSuchElementException& )
+ {
+ }
+ catch( WrappedTargetException& )
+ {
+ }
+ }
+ }
+ }
+ catch( Exception& )
+ {
+ }
+ }
+ }
+ catch( WrappedTargetException& )
+ {
+ }
+ }
+ return bRet;
+}
+
void PrintDialog::PrintPreviewWindow::DataChanged( const DataChangedEvent& i_rDCEvt )
{
// react on settings changed
if( i_rDCEvt.GetType() == DATACHANGED_SETTINGS )
{
- if( GetSettings().GetStyleSettings().GetHighContrastMode() )
+ if( useHCColorReplacement() )
maPageVDev.SetBackground( GetSettings().GetStyleSettings().GetWindowColor() );
else
maPageVDev.SetBackground( Color( COL_WHITE ) );
@@ -118,6 +188,23 @@ void PrintDialog::PrintPreviewWindow::Resize()
}
aScaledSize.Width() = long(aScaledSize.Width()*fScale);
aScaledSize.Height() = long(aScaledSize.Height()*fScale);
+
+ maPreviewSize = aScaledSize;
+
+ // #i104784# if we render the page too small then rounding issues result in
+ // layout artifacts looking really bad. So scale the page unto a device that is not
+ // full page size but not too small either. This also results in much better visual
+ // quality of the preview, e.g. when its height approaches the number of text lines
+ // find a good scaling factor
+ Size aPreviewMMSize( maPageVDev.PixelToLogic( aScaledSize, MapMode( MAP_100TH_MM ) ) );
+ double fZoom = double(maOrigSize.Height())/double(aPreviewMMSize.Height());
+ while( fZoom > 10 )
+ {
+ aScaledSize.Width() *= 2;
+ aScaledSize.Height() *= 2;
+ fZoom /= 2.0;
+ }
+
maPageVDev.SetOutputSizePixel( aScaledSize, FALSE );
}
@@ -129,9 +216,14 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
// replacement is active
Push();
Rectangle aTextRect( Point( 0, 0 ), aSize );
- Font aFont( GetSettings().GetStyleSettings().GetFieldFont() );
- aFont.SetSize( Size( 0, aSize.Height()/12 ) );
- SetFont( aFont );
+ DecorationView aVw( this );
+ aVw.DrawFrame( aTextRect, FRAME_DRAW_GROUP );
+ aTextRect.Left() += 2;
+ aTextRect.Top() += 2;
+ aTextRect.Right() -= 2;
+ aTextRect.Bottom() -= 2;
+ Font aFont( GetSettings().GetStyleSettings().GetLabelFont() );
+ SetZoomedPointFont( aFont );
DrawText( aTextRect, maReplacementString,
TEXT_DRAW_CENTER | TEXT_DRAW_VCENTER | TEXT_DRAW_WORDBREAK | TEXT_DRAW_MULTILINE
);
@@ -141,11 +233,11 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
{
GDIMetaFile aMtf( maMtf );
- Size aPreviewSize = maPageVDev.GetOutputSizePixel();
- Point aOffset( (aSize.Width() - aPreviewSize.Width()) / 2,
- (aSize.Height() - aPreviewSize.Height()) / 2 );
+ Point aOffset( (aSize.Width() - maPreviewSize.Width()) / 2,
+ (aSize.Height() - maPreviewSize.Height()) / 2 );
- const Size aLogicSize( maPageVDev.PixelToLogic( aPreviewSize, MapMode( MAP_100TH_MM ) ) );
+ Size aVDevSize( maPageVDev.GetOutputSizePixel() );
+ const Size aLogicSize( maPageVDev.PixelToLogic( aVDevSize, MapMode( MAP_100TH_MM ) ) );
Size aOrigSize( maOrigSize );
if( aOrigSize.Width() < 1 )
aOrigSize.Width() = aLogicSize.Width();
@@ -165,11 +257,11 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
SetMapMode( MAP_PIXEL );
maPageVDev.SetMapMode( MAP_PIXEL );
- DrawOutDev( aOffset, aPreviewSize, Point( 0, 0 ), aPreviewSize, maPageVDev );
+ DrawOutDev( aOffset, maPreviewSize, Point( 0, 0 ), aVDevSize, maPageVDev );
DecorationView aVw( this );
- aOffset.X() -= 1; aOffset.Y() -=1; aPreviewSize.Width() += 2; aPreviewSize.Height() += 2;
- aVw.DrawFrame( Rectangle( aOffset, aPreviewSize ), FRAME_DRAW_GROUP );
+ Rectangle aFrame( aOffset + Point( -1, -1 ), Size( maPreviewSize.Width() + 2, maPreviewSize.Height() + 2 ) );
+ aVw.DrawFrame( aFrame, FRAME_DRAW_GROUP );
}
}
@@ -211,9 +303,7 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi
#endif
SetQuickHelpText( aBuf.makeStringAndClear() );
maMtf = i_rNewPreview;
- if( GetSettings().GetStyleSettings().GetHighContrastMode() &&
- GetSettings().GetStyleSettings().GetWindowColor().IsDark()
- )
+ if( useHCColorReplacement() )
{
maMtf.ReplaceColors( Color( COL_BLACK ), Color( COL_WHITE ), 30 );
}
@@ -557,7 +647,7 @@ void PrintDialog::JobTabPage::setupLayout()
// add printer fixed line
maLayout.addWindow( &maPrinterFL );
// add print LB
- maLayout.addWindow( &maPrinters );
+ maLayout.addWindow( &maPrinters, 3 );
// create a row for details button/text and properties button
boost::shared_ptr< vcl::RowOrColumn > xDetRow( new vcl::RowOrColumn( &maLayout, false ) );
@@ -834,6 +924,7 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
maNUpPage.maBorderCB.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) );
maOptionsPage.maToFileBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
maOptionsPage.maReverseOrderBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
+ maOptionsPage.maCollateSingleJobsBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
maNUpPage.maPagesBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) );
// setup modify hdl
@@ -1027,6 +1118,11 @@ bool PrintDialog::isCollate()
return maJobPage.maCopyCountField.GetValue() > 1 ? maJobPage.maCollateBox.IsChecked() : FALSE;
}
+bool PrintDialog::isSingleJobs()
+{
+ return maOptionsPage.maCollateSingleJobsBox.IsChecked();
+}
+
static void setSmartId( Window* i_pWindow, const char* i_pType, sal_Int32 i_nId = -1, const rtl::OUString& i_rPropName = rtl::OUString() )
{
rtl::OUStringBuffer aBuf( 256 );
@@ -1049,10 +1145,17 @@ static void setSmartId( Window* i_pWindow, const char* i_pType, sal_Int32 i_nId
i_pWindow->SetSmartHelpId( SmartId( aBuf.makeStringAndClear(), HID_PRINTDLG ) );
}
-static void setHelpText( Window* i_pWindow, const Sequence< rtl::OUString >& i_rHelpTexts, sal_Int32 i_nIndex )
+static void setHelpText( Window* /*i_pWindow*/, const Sequence< rtl::OUString >& /*i_rHelpTexts*/, sal_Int32 /*i_nIndex*/ )
{
+ // without a help text set and the correct smartID,
+ // help texts will be retrieved from the online help system
+
+ // passed help texts for optional UI is used only for native dialogs which currently
+ // cannot access the same (rather implicit) mechanism
+ #if 0
if( i_nIndex >= 0 && i_nIndex < i_rHelpTexts.getLength() )
i_pWindow->SetHelpText( i_rHelpTexts.getConstArray()[i_nIndex] );
+ #endif
}
void updateMaxSize( const Size& i_rCheckSize, Size& o_rMaxSize )
@@ -1572,6 +1675,12 @@ void PrintDialog::setupOptionalUI()
maJobPage.maLayout.setBorders( nIndex-1, 0, 0, 0, aBorder.Width() );
#endif
+ // create auto mnemomnics now so they can be calculated in layout
+ ImplWindowAutoMnemonic( &maJobPage );
+ ImplWindowAutoMnemonic( &maNUpPage );
+ ImplWindowAutoMnemonic( &maOptionsPage );
+ ImplWindowAutoMnemonic( this );
+
// calculate job page
Size aMaxSize = maJobPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED );
// and layout page
@@ -1654,6 +1763,7 @@ void PrintDialog::checkControlDependencies()
maJobPage.maCollateImage.SetSizePixel( aImgSize );
maJobPage.maCollateImage.SetImage( bHC ? aHCImg : aImg );
maJobPage.maCollateImage.SetModeImage( aHCImg, BMP_COLOR_HIGHCONTRAST );
+ maJobPage.maLayout.resize();
// enable setup button only for printers that can be setup
bool bHaveSetup = maPController->getPrinter()->HasSupport( SUPPORT_SETUPDIALOG );
@@ -2444,6 +2554,11 @@ void PrintProgressDialog::tick()
setProgress( ++mnCur );
}
+void PrintProgressDialog::reset()
+{
+ setProgress( 0 );
+}
+
void PrintProgressDialog::Paint( const Rectangle& )
{
if( maProgressRect.IsEmpty() )
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 9987dae32dbb..c139ae1ffb30 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -61,13 +61,17 @@ public:
~ImplData();
VirtualDevice* mpVirDev;
- BOOL mbTopBorder:1;
+ long mnItemBorderWidth;
+ bool mbTopBorder:1;
+ bool mbDrawItemFrames:1;
};
StatusBar::ImplData::ImplData()
{
mpVirDev = NULL;
- mbTopBorder = FALSE;
+ mbTopBorder = false;
+ mbDrawItemFrames = false;
+ mnItemBorderWidth = 0;
}
StatusBar::ImplData::~ImplData()
@@ -351,9 +355,7 @@ Rectangle StatusBar::ImplGetItemRectPos( USHORT nPos ) const
{
Rectangle aRect;
ImplStatusItem* pItem;
-
pItem = mpItemList->GetObject( nPos );
-
if ( pItem )
{
if ( pItem->mbVisible )
@@ -372,6 +374,25 @@ Rectangle StatusBar::ImplGetItemRectPos( USHORT nPos ) const
// -----------------------------------------------------------------------
+USHORT StatusBar::ImplGetFirstVisiblePos() const
+{
+ ImplStatusItem* pItem;
+
+ for( USHORT nPos = 0; nPos < mpItemList->Count(); nPos++ )
+ {
+ pItem = mpItemList->GetObject( nPos );
+ if ( pItem )
+ {
+ if ( pItem->mbVisible )
+ return nPos;
+ }
+ }
+
+ return ~0;
+}
+
+// -----------------------------------------------------------------------
+
void StatusBar::ImplDrawText( BOOL bOffScreen, long nOldTextWidth )
{
// Das ueberschreiben der Item-Box verhindern
@@ -418,8 +439,9 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL
// Ausgabebereich berechnen
ImplStatusItem* pItem = mpItemList->GetObject( nPos );
- Rectangle aTextRect( aRect.Left()+1, aRect.Top()+1,
- aRect.Right()-1, aRect.Bottom()-1 );
+ long nW = mpImplData->mnItemBorderWidth + 1;
+ Rectangle aTextRect( aRect.Left()+nW, aRect.Top()+nW,
+ aRect.Right()-nW, aRect.Bottom()-nW );
Size aTextRectSize( aTextRect.GetSize() );
if ( bOffScreen )
@@ -470,17 +492,36 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL
SetClipRegion();
// Frame ausgeben
- if ( bDrawFrame && !(pItem->mnBits & SIB_FLAT) )
+ if ( bDrawFrame )
{
- USHORT nStyle;
+ if( mpImplData->mbDrawItemFrames )
+ {
+ if( !(pItem->mnBits & SIB_FLAT) )
+ {
+ USHORT nStyle;
- if ( pItem->mnBits & SIB_IN )
- nStyle = FRAME_DRAW_IN;
- else
- nStyle = FRAME_DRAW_OUT;
+ if ( pItem->mnBits & SIB_IN )
+ nStyle = FRAME_DRAW_IN;
+ else
+ nStyle = FRAME_DRAW_OUT;
+
+ DecorationView aDecoView( this );
+ aDecoView.DrawFrame( aRect, nStyle );
+ }
+ }
+ else if( nPos != ImplGetFirstVisiblePos() )
+ {
+ // draw separator
+ Point aFrom( aRect.TopLeft() );
+ aFrom.X()--;
+ aFrom.Y()++;
+ Point aTo( aRect.BottomLeft() );
+ aTo.X()--;
+ aTo.Y()--;
- DecorationView aDecoView( this );
- aDecoView.DrawFrame( aRect, nStyle );
+ DecorationView aDecoView( this );
+ aDecoView.DrawSeparator( aFrom, aTo );
+ }
}
if ( !ImplIsRecordLayout() )
@@ -688,8 +729,6 @@ void StatusBar::ImplCalcProgressRect()
}
if( ! bNativeOK )
maPrgsTxtPos.Y() = mnTextY;
-
-
}
// -----------------------------------------------------------------------
@@ -1227,8 +1266,11 @@ Rectangle StatusBar::GetItemRect( USHORT nItemId ) const
{
// Rechteck holen und Rahmen abziehen
aRect = ImplGetItemRectPos( nPos );
- aRect.Left()++;
- aRect.Right()--;
+ long nW = mpImplData->mnItemBorderWidth+1;
+ aRect.Top() += nW-1;
+ aRect.Bottom() -= nW-1;
+ aRect.Left() += nW;
+ aRect.Right() -= nW;
return aRect;
}
}
@@ -1248,8 +1290,9 @@ Point StatusBar::GetItemTextPos( USHORT nItemId ) const
// Rechteck holen
ImplStatusItem* pItem = mpItemList->GetObject( nPos );
Rectangle aRect = ImplGetItemRectPos( nPos );
- Rectangle aTextRect( aRect.Left()+1, aRect.Top()+1,
- aRect.Right()-1, aRect.Bottom()-1 );
+ long nW = mpImplData->mnItemBorderWidth + 1;
+ Rectangle aTextRect( aRect.Left()+nW, aRect.Top()+nW,
+ aRect.Right()-nW, aRect.Bottom()-nW );
Point aPos = ImplGetItemTextPos( aTextRect.GetSize(),
Size( GetTextWidth( pItem->maText ), GetTextHeight() ),
pItem->mnBits );
@@ -1524,9 +1567,9 @@ void StatusBar::SetBottomBorder( BOOL bBottomBorder )
void StatusBar::SetTopBorder( BOOL bTopBorder )
{
- if ( mpImplData->mbTopBorder != bTopBorder )
+ if ( mpImplData->mbTopBorder != static_cast<bool>(bTopBorder) )
{
- mpImplData->mbTopBorder = bTopBorder;
+ mpImplData->mbTopBorder = static_cast<bool>(bTopBorder);
ImplCalcBorder();
}
}
@@ -1690,7 +1733,22 @@ Size StatusBar::CalcWindowSizePixel() const
}
}
- nCalcHeight = nMinHeight+nBarTextOffset;
+ if( mpImplData->mbDrawItemFrames &&
+ pThis->IsNativeControlSupported( CTRL_FRAME, PART_BORDER ) )
+ {
+ ImplControlValue aControlValue( FRAME_DRAW_NODRAW );
+ Region aBound, aContent;
+ Region aNatRgn( Rectangle( Point( 0, 0 ), Size( 150, 50 ) ) );
+ if( pThis->GetNativeControlRegion(CTRL_FRAME, PART_BORDER,
+ aNatRgn, 0, aControlValue, rtl::OUString(), aBound, aContent) )
+ {
+ mpImplData->mnItemBorderWidth =
+ ( aBound.GetBoundRect().GetHeight() -
+ aContent.GetBoundRect().GetHeight() ) / 2;
+ }
+ }
+
+ nCalcHeight = nMinHeight+nBarTextOffset + 2*mpImplData->mnItemBorderWidth;
if( nCalcHeight < nProgressHeight+2 )
nCalcHeight = nProgressHeight+2;
diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx
index 02a8b6a5b717..874881c0c5ef 100644
--- a/vcl/source/window/tabdlg.cxx
+++ b/vcl/source/window/tabdlg.cxx
@@ -274,20 +274,3 @@ void TabDialog::AdjustLayout()
ImplPosControls();
}
-// -----------------------------------------------------------------------
-
-TabControl* TabDialog::ImplGetFirstTabControl() const
-{
- Window* pChild = GetWindow( WINDOW_FIRSTCHILD );
- while ( pChild )
- {
- if ( pChild->IsVisible() && (pChild != mpViewWindow) )
- {
- if ( pChild->GetType() == WINDOW_TABCONTROL )
- return (TabControl*)pChild;
- }
- pChild = pChild->GetWindow( WINDOW_NEXT );
- }
- return NULL;
-}
-
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 516bc53d8920..b47aa50a2e72 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -502,6 +502,13 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
}
}
+ static const char* pEnvHC = getenv( "SAL_FORCE_HC" );
+ if( pEnvHC && *pEnvHC )
+ {
+ aStyleSettings.SetHighContrastMode( TRUE );
+ rSettings.SetStyleSettings( aStyleSettings );
+ }
+
#ifdef DBG_UTIL
// Evt. AppFont auf Fett schalten, damit man feststellen kann,
// ob fuer die Texte auf anderen Systemen genuegend Platz
@@ -8147,7 +8154,7 @@ const XubString& Window::GetHelpText() const
{
rtl::OUStringBuffer aTxt( 64+mpWindowImpl->maHelpText.Len() );
aTxt.append( mpWindowImpl->maHelpText );
- aTxt.appendAscii( "\n+++++++++++++++\n" );
+ aTxt.appendAscii( "\n------------------\n" );
if( bStrHelpId )
aTxt.append( rtl::OUString( aStrHelpId ) );
else
diff --git a/vcl/source/window/window3.cxx b/vcl/source/window/window3.cxx
index 9c10c5f131bf..aecbc9c3ef0c 100644
--- a/vcl/source/window/window3.cxx
+++ b/vcl/source/window/window3.cxx
@@ -104,6 +104,12 @@ void Window::ImplMoveControlValue( ControlType nType, const ImplControlValue& aV
{
switch( nType )
{
+ case CTRL_SLIDER:
+ {
+ SliderValue* pSlVal = reinterpret_cast<SliderValue*>(aValue.getOptionalVal());
+ pSlVal->maThumbRect.Move( rDelta.X(), rDelta.Y() );
+ }
+ break;
case CTRL_SCROLLBAR:
{
ScrollbarValue* pScVal = reinterpret_cast<ScrollbarValue*>(aValue.getOptionalVal());
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 93e1b0837429..7b0512a1320b 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -295,7 +295,7 @@ static BOOL ImplCallCommand( Window* pChild, USHORT nEvt, void* pData = NULL,
else
{
// simulate mouseposition at center of window
- Size aSize = pChild->GetOutputSize();
+ Size aSize( pChild->GetOutputSizePixel() );
aPos = Point( aSize.getWidth()/2, aSize.getHeight()/2 );
}
}
@@ -1474,6 +1474,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
USHORT nMode;
USHORT nCode = rEvt.mnCode;
bool bHorz = rEvt.mbHorz;
+ bool bPixel = rEvt.mbDeltaIsPixel;
if ( nCode & KEY_MOD1 )
nMode = COMMAND_WHEEL_ZOOM;
else if ( nCode & KEY_MOD2 )
@@ -1486,7 +1487,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
bHorz = true;
}
- CommandWheelData aWheelData( rEvt.mnDelta, rEvt.mnNotchDelta, rEvt.mnScrollLines, nMode, nCode, bHorz );
+ CommandWheelData aWheelData( rEvt.mnDelta, rEvt.mnNotchDelta, rEvt.mnScrollLines, nMode, nCode, bHorz, bPixel );
Point aMousePos( rEvt.mnX, rEvt.mnY );
BOOL bRet = TRUE;