summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorBjörn Milcke <bm@openoffice.org>2002-08-01 10:41:27 +0000
committerBjörn Milcke <bm@openoffice.org>2002-08-01 10:41:27 +0000
commita3eca22f5d1bc1848b6716fdd688f5f165ef5771 (patch)
tree7f468e4270e976b33e64a1460d30aca4dcb05190 /sfx2
parentb35e1016fba9c083cfd99d8981c0a3ce7febfa24 (diff)
#101126# support high-contrast mode (change draw-mode)
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/new.cxx31
1 files changed, 29 insertions, 2 deletions
diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx
index 41ddd67d8a74..fdfbc967d729 100644
--- a/sfx2/source/doc/new.cxx
+++ b/sfx2/source/doc/new.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: new.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: mba $ $Date: 2002-07-08 07:38:48 $
+ * last change: $Author: bm $ $Date: 2002-08-01 11:41:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -142,7 +142,15 @@
#ifndef _SV_WAITOBJ_HXX
#include <vcl/waitobj.hxx>
#endif
+#ifndef INCLUDED_SVTOOLS_ACCESSIBILITYOPTIONS_HXX
+#include <svtools/accessibilityoptions.hxx>
+#endif
+// Draw modes
+#define OUTPUT_DRAWMODE_COLOR (DRAWMODE_DEFAULT)
+#define OUTPUT_DRAWMODE_GRAYSCALE (DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_BLACKTEXT | DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT)
+#define OUTPUT_DRAWMODE_BLACKWHITE (DRAWMODE_BLACKLINE | DRAWMODE_BLACKTEXT | DRAWMODE_WHITEFILL | DRAWMODE_GRAYBITMAP | DRAWMODE_WHITEGRADIENT)
+#define OUTPUT_DRAWMODE_CONTRAST (DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT)
//========================================================================
@@ -252,6 +260,11 @@ SfxPreviewWin::SfxPreviewWin(
: Window(pParent, rResId), rDocShell( rDocSh )
{
SetHelpId( HID_PREVIEW_FRAME );
+
+ // adjust contrast mode initially
+ SvtAccessibilityOptions aAccOptions;
+ bool bUseContrast = aAccOptions.GetIsForDrawings() && GetSettings().GetStyleSettings().GetHighContrastMode();
+ SetDrawMode( bUseContrast ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
}
void SfxPreviewWin::Paint( const Rectangle& rRect )
@@ -261,6 +274,20 @@ void SfxPreviewWin::Paint( const Rectangle& rRect )
delete pFile;
}
+void SfxPreviewWin::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ Window::DataChanged( rDCEvt );
+
+ if( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ // adjust contrast mode initially
+ SvtAccessibilityOptions aAccOptions;
+ bool bUseContrast = aAccOptions.GetIsForDrawings() && GetSettings().GetStyleSettings().GetHighContrastMode();
+ SetDrawMode( bUseContrast ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
+ }
+}
+
class SfxNewFileDialog_Impl
{