summaryrefslogtreecommitdiffstats
path: root/vcl/source/window/tabpage.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-05-10 14:50:49 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-05-10 14:50:49 +0000
commit29e8830e740c98ade037769557788dcf822921d6 (patch)
treefd4a399d9b8e19d69791736216d1cc923945433b /vcl/source/window/tabpage.cxx
parentINTEGRATION: CWS nwf (1.11.66); FILE MERGED (diff)
downloadcore-29e8830e740c98ade037769557788dcf822921d6.tar.gz
core-29e8830e740c98ade037769557788dcf822921d6.zip
INTEGRATION: CWS nwf (1.9.2); FILE MERGED
2004/03/15 17:28:18 ssa 1.9.2.3: #i25130# correct tabpage init 2004/03/15 13:34:30 ssa 1.9.2.2: #i25130# draw native tabpages only inside tabcontrols 2004/02/27 08:31:25 ssa 1.9.2.1: #i25130# initial native widget framework, merged from srx645
Diffstat (limited to 'vcl/source/window/tabpage.cxx')
-rw-r--r--vcl/source/window/tabpage.cxx28
1 files changed, 25 insertions, 3 deletions
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index 8801008cd80f..0350c5f38fdb 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: tabpage.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: obo $ $Date: 2004-02-20 08:52:14 $
+ * last change: $Author: hr $ $Date: 2004-05-10 15:50:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -97,6 +97,11 @@ void TabPage::ImplInit( Window* pParent, WinBits nStyle )
Window::ImplInit( pParent, nStyle, NULL );
ImplInitSettings();
+
+ // if the tabpage is drawn (ie filled) by a native widget, make sure all contols will have transparent background
+ // otherwise they will paint with a wrong background
+ if( IsNativeControlSupported(CTRL_TAB_BODY, PART_ENTIRE_CONTROL) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) )
+ EnableChildTransparentMode( TRUE );
}
// -----------------------------------------------------------------------
@@ -182,7 +187,24 @@ void TabPage::DataChanged( const DataChangedEvent& rDCEvt )
void TabPage::Paint( const Rectangle& rRect )
{
- Window::Paint( rRect );
+ // draw native tabpage only inside tabcontrols, standalone tabpages look ugly (due to bad dialog design)
+ if( IsNativeControlSupported(CTRL_TAB_BODY, PART_ENTIRE_CONTROL) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) )
+ {
+ const ImplControlValue aControlValue( BUTTONVALUE_DONTKNOW, rtl::OUString(), 0 );
+
+ ControlState nState = CTRL_STATE_ENABLED;
+ int part = PART_ENTIRE_CONTROL;
+ if ( !IsEnabled() )
+ nState &= ~CTRL_STATE_ENABLED;
+ if ( HasFocus() )
+ nState |= CTRL_STATE_FOCUSED;
+ Point aPoint;
+ // pass the whole window region to NWF as the tab body might be a gradient or bitmap
+ // that has to be scaled properly, clipping makes sure that we do not paint too much
+ Region aCtrlRegion( Rectangle( aPoint, GetOutputSizePixel() ) );
+ DrawNativeControl( CTRL_TAB_BODY, part, aCtrlRegion, nState,
+ aControlValue, rtl::OUString() );
+ }
}
// -----------------------------------------------------------------------