diff options
author | Oliver Bolte <obo@openoffice.org> | 2006-03-22 09:40:09 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2006-03-22 09:40:09 +0000 |
commit | 2e8db55f79ea5b725814ecf26fd41028c0dc581c (patch) | |
tree | b2827c668204985cdd8693a28612b13f8e23cfba | |
parent | 204ea409452fbb803343a58184741589a975da6f (diff) |
INTEGRATION: CWS nwfrtl (1.22.14); FILE MERGED
2006/02/20 15:47:40 pl 1.22.14.2: RESYNC: (1.22-1.24); FILE MERGED
2006/02/06 18:02:56 pl 1.22.14.1: #i54929# #i61535# #i61536# make scrollbar, combobox, spinfield, toolbar grip work in NWF on RTL-UI
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 72 |
1 files changed, 49 insertions, 23 deletions
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index d29cae9e112d..8e64b96d1b6b 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -4,9 +4,9 @@ * * $RCSfile: salnativewidgets-gtk.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.25 $ * - * last change: $Author: kz $ $Date: 2006-02-03 17:15:07 $ + * last change: $Author: obo $ $Date: 2006-03-22 10:40:09 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -826,15 +826,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, returnVal = TRUE; } - if ( (nType==CTRL_SPINBOX) && ((nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN)) ) - { - rNativeBoundingRegion = NWGetSpinButtonRect( nType, nPart, rControlRegion.GetBoundRect(), - nState, aValue, rControlHandle, aCaption ); - rNativeContentRegion = rNativeBoundingRegion; - - returnVal = TRUE; - } - if ( (nType==CTRL_COMBOBOX) && (nPart==PART_BUTTON_DOWN) ) + if ( (nType==CTRL_COMBOBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { rNativeBoundingRegion = NWGetComboBoxButtonRect( nType, nPart, rControlRegion.GetBoundRect(), nState, aValue, rControlHandle, aCaption ); @@ -842,7 +834,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType, returnVal = TRUE; } - if ( (nType==CTRL_SPINBOX) && ((nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN)) ) + if ( (nType==CTRL_SPINBOX) && ((nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) ) { rNativeBoundingRegion = NWGetSpinButtonRect( nType, nPart, rControlRegion.GetBoundRect(), nState, @@ -1257,6 +1249,13 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType nType, ControlPart nPart, gint hShim = 0; gint x,y,w,h; + // make controlvalue rectangles relative to area + thumbRect.Move( -rControlRectangle.Left(), -rControlRectangle.Top() ); + button11BoundRect.Move( -rControlRectangle.Left(), -rControlRectangle.Top() ); + button22BoundRect.Move( -rControlRectangle.Left(), -rControlRectangle.Top() ); + button12BoundRect.Move( -rControlRectangle.Left(), -rControlRectangle.Top() ); + button21BoundRect.Move( -rControlRectangle.Left(), -rControlRectangle.Top() ); + NWEnsureGTKButton(); NWEnsureGTKScrollbars(); NWEnsureGTKArrow(); @@ -1874,11 +1873,18 @@ static Rectangle NWGetSpinButtonRect( ControlType nType, buttonRect.setY( aAreaRect.Top() ); buttonRect.Bottom() = buttonRect.Top() + (aAreaRect.GetHeight() / 2); } - else + else if( nPart == PART_BUTTON_DOWN ) { buttonRect.setY( aAreaRect.Top() + (aAreaRect.GetHeight() / 2) ); buttonRect.Bottom() = aAreaRect.Bottom(); // cover area completely } + else + { + buttonRect.Right() = buttonRect.Left()-1; + buttonRect.Left() = aAreaRect.Left(); + buttonRect.Top() = aAreaRect.Top(); + buttonRect.Bottom() = aAreaRect.Bottom(); + } return( buttonRect ); } @@ -1960,7 +1966,7 @@ BOOL GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, NWSetWidgetState( gComboWidget, nState, stateType ); NWSetWidgetState( gArrowWidget, nState, stateType ); - buttonRect = NWGetComboBoxButtonRect( nType, nPart, pixmapRect, nState, aValue, rControlHandle, aCaption ); + buttonRect = NWGetComboBoxButtonRect( nType, PART_BUTTON_DOWN, pixmapRect, nState, aValue, rControlHandle, aCaption ); if( nPart == PART_BUTTON_DOWN ) buttonRect.Left() += 1; @@ -2017,6 +2023,7 @@ static Rectangle NWGetComboBoxButtonRect( ControlType nType, { Rectangle aButtonRect; gint nArrowWidth; + gint nButtonWidth; gint nFocusWidth; gint nFocusPad; @@ -2027,11 +2034,32 @@ static Rectangle NWGetComboBoxButtonRect( ControlType nType, "focus-padding", &nFocusPad, NULL ); nArrowWidth = MIN_ARROW_SIZE + (GTK_MISC(gArrowWidget)->xpad * 2); - aButtonRect.SetSize( Size( nArrowWidth + ((BTN_CHILD_SPACING + gDropdownWidget->style->xthickness) * 2) - + (2 * (nFocusWidth+nFocusPad)), - aAreaRect.GetHeight() ) ); - aButtonRect.SetPos( Point( aAreaRect.Left() + aAreaRect.GetWidth() - aButtonRect.GetWidth(), - aAreaRect.Top() ) ); + nButtonWidth = nArrowWidth + + ((BTN_CHILD_SPACING + gDropdownWidget->style->xthickness) * 2) + + (2 * (nFocusWidth+nFocusPad)); + if( nPart == PART_BUTTON_DOWN ) + { + aButtonRect.SetSize( Size( nButtonWidth, aAreaRect.GetHeight() ) ); + aButtonRect.SetPos( Point( aAreaRect.Left() + aAreaRect.GetWidth() - nButtonWidth, + aAreaRect.Top() ) ); + } + else if( nPart == PART_SUB_EDIT ) + { + NWEnsureGTKCombo(); + + + gint adjust_x = GTK_CONTAINER(gComboWidget)->border_width + + nFocusWidth + + nFocusPad; + gint adjust_y = adjust_x + gComboWidget->style->ythickness; + adjust_x += gComboWidget->style->xthickness; + aButtonRect.SetSize( Size( aAreaRect.GetWidth() - nButtonWidth - 2 * adjust_x, + aAreaRect.GetHeight() - 2 * adjust_y ) ); + Point aEditPos = aAreaRect.TopLeft(); + aEditPos.X() += adjust_x; + aEditPos.Y() += adjust_y; + aButtonRect.SetPos( aEditPos ); + } return( aButtonRect ); } @@ -2326,8 +2354,8 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar( ToolbarValue* pVal = (ToolbarValue*)aValue.getOptionalVal(); if( pVal ) { - g_x = rControlRectangle.Left() + pVal->maGripRect.Left(); - g_y = rControlRectangle.Top() + pVal->maGripRect.Top(); + g_x = pVal->maGripRect.Left(); + g_y = pVal->maGripRect.Top(); g_w = pVal->maGripRect.GetWidth(); g_h = pVal->maGripRect.GetHeight(); } @@ -3081,8 +3109,6 @@ BOOL GtkSalGraphics::NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRe XCopyArea( GetXDisplay(), GDK_DRAWABLE_XID(pPixmap), GetDrawable(), SelectFont(), 0, 0, dstRect.GetWidth(), dstRect.GetHeight(), dstRect.Left(), dstRect.Top() ); - X11SalGraphics::YieldGraphicsExpose( GetXDisplay(), NULL, GetDrawable() ); - return( TRUE ); } |