summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-10-29 09:25:50 +0000
committerRüdiger Timm <rt@openoffice.org>2008-10-29 09:25:50 +0000
commit011bcd1ea1e8ce10f6b9946d8d44d05a59387b8c (patch)
tree8037c716c846e504acc22b8082c5b886f661203d /vcl
parent0b3f346d173ae177ab2656b5e9953e5a310eebe1 (diff)
CWS-TOOLING: integrate CWS vcl95
Diffstat (limited to 'vcl')
-rw-r--r--vcl/aqua/source/window/salframe.cxx1
-rw-r--r--vcl/inc/vcl/cmdevt.hxx44
-rw-r--r--vcl/inc/vcl/edit.hxx3
-rw-r--r--vcl/inc/vcl/salwtype.hxx28
-rw-r--r--vcl/inc/vcl/settings.hxx11
-rw-r--r--vcl/inc/vcl/window.hxx3
-rw-r--r--vcl/os2/source/window/salframe.cxx2
-rw-r--r--vcl/source/app/settings.cxx6
-rw-r--r--vcl/source/control/edit.cxx19
-rw-r--r--vcl/source/gdi/bitmap.cxx3
-rw-r--r--vcl/source/gdi/outdev3.cxx2
-rw-r--r--vcl/source/window/window.cxx10
-rw-r--r--vcl/source/window/winproc.cxx87
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx7
-rw-r--r--vcl/unx/kde/salnativewidgets-kde.cxx2
-rw-r--r--vcl/win/source/window/salframe.cxx109
16 files changed, 331 insertions, 6 deletions
diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx
index 0be5fc6bb36b..65bca3ea6862 100644
--- a/vcl/aqua/source/window/salframe.cxx
+++ b/vcl/aqua/source/window/salframe.cxx
@@ -1091,6 +1091,7 @@ void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
Color aBackgroundColor = Color( 0xEC, 0xEC, 0xEC );
aStyleSettings.Set3DColors( aBackgroundColor );
aStyleSettings.SetFaceColor( aBackgroundColor );
+ aStyleSettings.SetInactiveTabColor( aBackgroundColor );
// [FIXME] Dialog Color is the one to modify to complete Aqua Theme on windows
aStyleSettings.SetDialogColor( aBackgroundColor );
diff --git a/vcl/inc/vcl/cmdevt.hxx b/vcl/inc/vcl/cmdevt.hxx
index febc108280e1..8cb0a5e3ab17 100644
--- a/vcl/inc/vcl/cmdevt.hxx
+++ b/vcl/inc/vcl/cmdevt.hxx
@@ -340,6 +340,37 @@ class VCL_DLLPUBLIC CommandDialogData
#define MEDIA_COMMAND_VOLUME_MUTE ((sal_Int16)16)// Mute the volume.
#define MEDIA_COMMAND_VOLUME_UP ((sal_Int16)17)// Raise the volume.
+
+// ------------------------------
+// - CommandSelectionChangeData -
+// ------------------------------
+
+class VCL_DLLPUBLIC CommandSelectionChangeData
+{
+private:
+ ULONG mnStart;
+ ULONG mnEnd;
+
+public:
+ CommandSelectionChangeData();
+ CommandSelectionChangeData( ULONG nStart, ULONG nEnd );
+
+ ULONG GetStart() const { return mnStart; }
+ ULONG GetEnd() const { return mnEnd; }
+};
+
+inline CommandSelectionChangeData::CommandSelectionChangeData()
+{
+ mnStart = mnEnd = 0;
+}
+
+inline CommandSelectionChangeData::CommandSelectionChangeData( ULONG nStart,
+ ULONG nEnd )
+{
+ mnStart = nStart;
+ mnEnd = nEnd;
+}
+
// ----------------
// - CommandEvent -
// ----------------
@@ -361,7 +392,8 @@ class VCL_DLLPUBLIC CommandDialogData
#define COMMAND_INPUTLANGUAGECHANGE ((USHORT)15)
#define COMMAND_SHOWDIALOG ((USHORT)16)
#define COMMAND_MEDIA ((USHORT)17)
-
+#define COMMAND_SELECTIONCHANGE ((USHORT)18)
+#define COMMAND_PREPARERECONVERSION ((USHORT)19)
#define COMMAND_USER ((USHORT)4096)
class VCL_DLLPUBLIC CommandEvent
@@ -390,6 +422,7 @@ public:
const CommandModKeyData* GetModKeyData() const;
const CommandDialogData* GetDialogData() const;
sal_Int16 GetMediaCommand() const;
+ const CommandSelectionChangeData* GetSelectionChangeData() const;
};
inline CommandEvent::CommandEvent()
@@ -472,4 +505,13 @@ inline sal_Int16 CommandEvent::GetMediaCommand() const
return 0;
}
+inline const CommandSelectionChangeData* CommandEvent::GetSelectionChangeData() const
+{
+ if( mnCommand == COMMAND_SELECTIONCHANGE )
+ return (const CommandSelectionChangeData*)mpData;
+ else
+ return NULL;
+}
+
+
#endif // _VCL_CMDEVT_HXX
diff --git a/vcl/inc/vcl/edit.hxx b/vcl/inc/vcl/edit.hxx
index 54c188c077bb..968acd1ae6bb 100644
--- a/vcl/inc/vcl/edit.hxx
+++ b/vcl/inc/vcl/edit.hxx
@@ -245,6 +245,9 @@ public:
static PopupMenu* CreatePopupMenu();
static void DeletePopupMenu( PopupMenu* pMenu );
+
+ virtual XubString GetSurroundingText() const;
+ virtual Selection GetSurroundingTextSelection() const;
};
inline ULONG Edit::IsUpdateDataEnabled() const
diff --git a/vcl/inc/vcl/salwtype.hxx b/vcl/inc/vcl/salwtype.hxx
index 6877e12ff1a0..0d5f23e28d2f 100644
--- a/vcl/inc/vcl/salwtype.hxx
+++ b/vcl/inc/vcl/salwtype.hxx
@@ -106,7 +106,10 @@ class ImplFontSelectData;
#define SALEVENT_INPUTLANGUAGECHANGE ((USHORT)40)
#define SALEVENT_SHOWDIALOG ((USHORT)41)
#define SALEVENT_MENUBUTTONCOMMAND ((USHORT)42)
-#define SALEVENT_COUNT ((USHORT)42)
+#define SALEVENT_SURROUNDINGTEXTREQUEST ((USHORT)43)
+#define SALEVENT_SURROUNDINGTEXTSELECTIONCHANGE ((USHORT)44)
+#define SALEVENT_STARTRECONVERSION ((USHORT)45)
+#define SALEVENT_COUNT ((USHORT)45)
// MOUSELEAVE must send, when the pointer leave the client area and
// the mouse is not captured
@@ -226,6 +229,29 @@ struct SalInputContextChangeEvent
#endif // __cplusplus
+#ifdef __cplusplus
+
+// SURROUNDINGTEXTREQUEST
+struct SalSurroundingTextRequestEvent
+{
+ UniString maText; // Text
+ ULONG mnStart; // The beggining index of selected range
+ ULONG mnEnd; // The end index of selected range
+};
+
+#endif // __cplusplus
+
+#ifdef __cplusplus
+
+// SURROUNDINGTEXTSELECTIONCHANGE
+struct SalSurroundingTextSelectionChangeEvent
+{
+ ULONG mnStart; // The beggining index of selected range
+ ULONG mnEnd; // The end index of selected range
+};
+
+#endif // __cplusplus
+
// ------------------
// - SalFrame-Types -
// ------------------
diff --git a/vcl/inc/vcl/settings.hxx b/vcl/inc/vcl/settings.hxx
index 57681a39ed40..5ee27e3aeb31 100644
--- a/vcl/inc/vcl/settings.hxx
+++ b/vcl/inc/vcl/settings.hxx
@@ -382,6 +382,8 @@ private:
Color maWindowColor;
Color maWindowTextColor;
Color maWorkspaceColor;
+ Color maActiveTabColor;
+ Color maInactiveTabColor;
Font maAppFont;
Font maHelpFont;
Font maTitleFont;
@@ -709,6 +711,15 @@ public:
const Color& GetMonoColor() const
{ return mpData->maMonoColor; }
+ void SetActiveTabColor( const Color& rColor )
+ { CopyData(); mpData->maActiveTabColor = rColor; }
+ const Color& GetActiveTabColor() const
+ { return mpData->maActiveTabColor; }
+ void SetInactiveTabColor( const Color& rColor )
+ { CopyData(); mpData->maInactiveTabColor = rColor; }
+ const Color& GetInactiveTabColor() const
+ { return mpData->maInactiveTabColor; }
+
void SetHighContrastMode( BOOL bHighContrast )
{ CopyData(); mpData->mnHighContrast = bHighContrast; }
BOOL GetHighContrastMode() const
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index 12b8cc04984b..d51a794441b0 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -1129,6 +1129,9 @@ public:
/* mark Window for deletion in top of event queue
*/
void doLazyDelete();
+
+ virtual XubString GetSurroundingText() const;
+ virtual Selection GetSurroundingTextSelection() const;
};
diff --git a/vcl/os2/source/window/salframe.cxx b/vcl/os2/source/window/salframe.cxx
index 474a87f9d1bf..e90c7f9bf4af 100644
--- a/vcl/os2/source/window/salframe.cxx
+++ b/vcl/os2/source/window/salframe.cxx
@@ -2123,6 +2123,7 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings )
if ( bCompBorder )
{
aStyleSettings.SetFaceColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) );
+ aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
aStyleSettings.SetLightColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONLIGHT, 0 ) ) );
aStyleSettings.SetLightBorderColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONMIDDLE, 0 ) ) );
aStyleSettings.SetShadowColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_BUTTONDARK, 0 ) ) );
@@ -2144,6 +2145,7 @@ void Os2SalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetLabelTextColor( aStyleSettings.GetGroupTextColor() );
aStyleSettings.SetInfoTextColor( aStyleSettings.GetGroupTextColor() );
aStyleSettings.SetWindowColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_WINDOW, 0 ) ) );
+ aStyleSettings.SetActiveTabColor( aStyleSettings.GetWindowColor() );
aStyleSettings.SetWindowTextColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_WINDOWTEXT, 0 ) ) );
aStyleSettings.SetFieldColor( ImplOS2ColorToSal( WinQuerySysColor( HWND_DESKTOP, SYSCLR_ENTRYFIELD, 0 ) ) );
aStyleSettings.SetFieldTextColor( aStyleSettings.GetWindowTextColor() );
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 47577ecc4260..12213c25a64f 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -485,6 +485,8 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
maWindowColor( rData.maWindowColor ),
maWindowTextColor( rData.maWindowTextColor ),
maWorkspaceColor( rData.maWorkspaceColor ),
+ maActiveTabColor( rData.maActiveTabColor ),
+ maInactiveTabColor( rData.maInactiveTabColor ),
maAppFont( rData.maAppFont ),
maHelpFont( rData.maAppFont ),
maTitleFont( rData.maTitleFont ),
@@ -599,6 +601,8 @@ void ImplStyleData::SetStandardStyles()
maMenuHighlightTextColor = Color( COL_WHITE );
maHighlightColor = Color( COL_BLUE );
maHighlightTextColor = Color( COL_WHITE );
+ maActiveTabColor = Color( COL_WHITE );
+ maInactiveTabColor = Color( COL_LIGHTGRAY );
maDisableColor = Color( COL_GRAY );
maHelpColor = Color( 0xFF, 0xFF, 0xE0 );
maHelpTextColor = Color( COL_BLACK );
@@ -1028,6 +1032,8 @@ BOOL StyleSettings::operator ==( const StyleSettings& rSet ) const
(mpData->maMenuHighlightTextColor == rSet.mpData->maMenuHighlightTextColor) &&
(mpData->maHighlightColor == rSet.mpData->maHighlightColor) &&
(mpData->maHighlightTextColor == rSet.mpData->maHighlightTextColor) &&
+ (mpData->maActiveTabColor == rSet.mpData->maActiveTabColor) &&
+ (mpData->maInactiveTabColor == rSet.mpData->maInactiveTabColor) &&
(mpData->maDisableColor == rSet.mpData->maDisableColor) &&
(mpData->maHelpColor == rSet.mpData->maHelpColor) &&
(mpData->maHelpTextColor == rSet.mpData->maHelpTextColor) &&
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 4ed4b0968116..8754aaabf3a9 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2221,6 +2221,12 @@ void Edit::Command( const CommandEvent& rCEvt )
SetCursorRect();
}
}
+ else if ( rCEvt.GetCommand() == COMMAND_SELECTIONCHANGE )
+ {
+ const CommandSelectionChangeData *pData = rCEvt.GetSelectionChangeData();
+ Selection aSelection( pData->GetStart(), pData->GetEnd() );
+ SetSelection(aSelection);
+ }
else
Control::Command( rCEvt );
}
@@ -2981,3 +2987,16 @@ void ImplSubEdit::Modify()
{
GetParent()->Modify();
}
+
+XubString Edit::GetSurroundingText() const
+{
+ if ( mpSubEdit )
+ return mpSubEdit->GetSurroundingText();
+ else
+ return maText;
+}
+
+Selection Edit::GetSurroundingTextSelection() const
+{
+ return GetSelection();
+}
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index 2d12a67efedf..572946f71690 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -513,6 +513,9 @@ void Bitmap::ReleaseAccess( BitmapReadAccess* pBitmapAccess )
BOOL Bitmap::Erase( const Color& rFillColor )
{
+ if( !(*this) )
+ return TRUE;
+
BitmapWriteAccess* pWriteAcc = AcquireWriteAccess();
BOOL bRet = FALSE;
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index cb5357fb6a3e..dafb288f4b68 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -7173,7 +7173,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
long nMnemonicX = 0;
long nMnemonicY = 0;
long nMnemonicWidth = 0;
- if ( nStyle & TEXT_DRAW_MNEMONIC )
+ if ( (nStyle & TEXT_DRAW_MNEMONIC) && nLen > 1 )
{
aStr = GetNonMnemonicString( aStr, nMnemonicPos );
if ( nMnemonicPos != STRING_NOTFOUND )
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 8116cbf04088..3fdc789bf781 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -9827,3 +9827,13 @@ void Window::PaintToDevice( OutputDevice* pDev, const Point& rPos, const Size& /
pDev->Pop();
}
+XubString Window::GetSurroundingText() const
+{
+ return XubString::EmptyString();
+}
+
+Selection Window::GetSurroundingTextSelection() const
+{
+ return Selection( 0, 0 );
+}
+
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 89007a3421da..56fcdee394d3 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -2289,6 +2289,78 @@ static long ImplHandleShowDialog( Window* pWindow, int nDialogId )
// -----------------------------------------------------------------------
+static void ImplHandleSurroundingTextRequest( Window *pWindow,
+ XubString& rText,
+ Selection &rSelRange )
+{
+ Window* pChild = ImplGetKeyInputWindow( pWindow );
+
+ if ( !pChild )
+ {
+ rText = XubString::EmptyString();
+ rSelRange.setMin( 0 );
+ rSelRange.setMax( 0 );
+ }
+ else
+ {
+
+ rText = pChild->GetSurroundingText();
+ Selection aSel = pChild->GetSurroundingTextSelection();
+ rSelRange.setMin( aSel.Min() );
+ rSelRange.setMax( aSel.Max() );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+static void ImplHandleSalSurroundingTextRequest( Window *pWindow,
+ SalSurroundingTextRequestEvent *pEvt )
+{
+ Selection aSelRange;
+ ImplHandleSurroundingTextRequest( pWindow, pEvt->maText, aSelRange );
+
+ aSelRange.Justify();
+
+ if( aSelRange.Min() < 0 )
+ pEvt->mnStart = 0;
+ else if( aSelRange.Min() > pEvt->maText.Len() )
+ pEvt->mnStart = pEvt->maText.Len();
+ else
+ pEvt->mnStart = aSelRange.Min();
+
+ if( aSelRange.Max() < 0 )
+ pEvt->mnStart = 0;
+ else if( aSelRange.Max() > pEvt->maText.Len() )
+ pEvt->mnEnd = pEvt->maText.Len();
+ else
+ pEvt->mnEnd = aSelRange.Max();
+}
+
+// -----------------------------------------------------------------------
+
+static void ImplHandleSurroundingTextSelectionChange( Window *pWindow,
+ ULONG nStart,
+ ULONG nEnd )
+{
+ Window* pChild = ImplGetKeyInputWindow( pWindow );
+ if( pChild )
+ {
+ CommandSelectionChangeData data( nStart, nEnd );
+ ImplCallCommand( pChild, COMMAND_SELECTIONCHANGE, &data );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+static void ImplHandleStartReconversion( Window *pWindow )
+{
+ Window* pChild = ImplGetKeyInputWindow( pWindow );
+ if( pChild )
+ ImplCallCommand( pChild, COMMAND_PREPARERECONVERSION );
+}
+
+// -----------------------------------------------------------------------
+
long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
USHORT nEvent, const void* pEvent )
{
@@ -2521,7 +2593,20 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
nRet = ImplHandleShowDialog( pWindow, nDialogID );
}
break;
-
+ case SALEVENT_SURROUNDINGTEXTREQUEST:
+ ImplHandleSalSurroundingTextRequest( pWindow, (SalSurroundingTextRequestEvent*)pEvent );
+ break;
+ case SALEVENT_SURROUNDINGTEXTSELECTIONCHANGE:
+ {
+ SalSurroundingTextSelectionChangeEvent* pEvt
+ = (SalSurroundingTextSelectionChangeEvent*)pEvent;
+ ImplHandleSurroundingTextSelectionChange( pWindow,
+ pEvt->mnStart,
+ pEvt->mnEnd );
+ }
+ case SALEVENT_STARTRECONVERSION:
+ ImplHandleStartReconversion( pWindow );
+ break;
#ifdef DBG_UTIL
default:
DBG_ERROR1( "ImplWindowFrameProc(): unknown event (%lu)", (ULONG)nEvent );
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 784826b032b9..267886cea433 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -3263,6 +3263,11 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
gdk_color_free (link_color);
}
+ // Tab colors
+ aStyleSet.SetActiveTabColor( aBackFieldColor ); // same as the window color.
+ Color aSelectedBackColor = getColor( pStyle->bg[GTK_STATE_ACTIVE] );
+ aStyleSet.SetInactiveTabColor( aSelectedBackColor );
+
// menu disabled entries handling
aStyleSet.SetSkipDisabledInMenus( TRUE );
// menu colors
@@ -3702,7 +3707,7 @@ static void NWEnsureGTKSpinButton( int nScreen )
{
if ( !gWidgetData[nScreen].gSpinButtonWidget )
{
- GtkAdjustment *adj = GTK_ADJUSTMENT( gtk_adjustment_new(0, 0, 2, 1, 1, 1) );
+ GtkAdjustment *adj = GTK_ADJUSTMENT( gtk_adjustment_new(0, 0, 1, 1, 1, 0) );
gWidgetData[nScreen].gSpinButtonWidget = gtk_spin_button_new( adj, 1, 2 );
//Setting non-editable means it doesn't blink, so there's no timeouts
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index 9252d0b9d5c5..6667520c3982 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -1919,6 +1919,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetFieldColor( aBase );
aStyleSettings.SetHelpColor( aBase );
aStyleSettings.SetWindowColor( aBase );
+ aStyleSettings.SetActiveTabColor( aBase );
// Buttons
aStyleSettings.SetButtonTextColor( toColor( qColorGroup.buttonText() ) );
@@ -1933,6 +1934,7 @@ void KDESalFrame::UpdateSettings( AllSettings& rSettings )
// Background
aStyleSettings.Set3DColors( aBack );
aStyleSettings.SetFaceColor( aBack );
+ aStyleSettings.SetInactiveTabColor( aBack );
aStyleSettings.SetDialogColor( aBack );
if( aBack == COL_LIGHTGRAY )
aStyleSettings.SetCheckedColor( Color( 0xCC, 0xCC, 0xCC ) );
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 1da5a3fdc8ac..dce8947f49d3 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -30,6 +30,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
+
+// i72022: ad-hoc to forcibly enable reconversion
+#if WINVER < 0x0500
+#undef WINVER
+#define WINVER 0x0500
+#endif
+
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -2894,6 +2901,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetDeactiveColor( ImplWinColorToSal( GetSysColor( COLOR_GRADIENTINACTIVECAPTION ) ) );
}
aStyleSettings.SetFaceColor( ImplWinColorToSal( GetSysColor( COLOR_3DFACE ) ) );
+ aStyleSettings.SetInactiveTabColor( aStyleSettings.GetFaceColor() );
aStyleSettings.SetLightColor( ImplWinColorToSal( GetSysColor( COLOR_3DHILIGHT ) ) );
aStyleSettings.SetLightBorderColor( ImplWinColorToSal( GetSysColor( COLOR_3DLIGHT ) ) );
aStyleSettings.SetShadowColor( ImplWinColorToSal( GetSysColor( COLOR_3DSHADOW ) ) );
@@ -2911,6 +2919,7 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetLabelTextColor( aStyleSettings.GetRadioCheckTextColor() );
aStyleSettings.SetInfoTextColor( aStyleSettings.GetRadioCheckTextColor() );
aStyleSettings.SetWindowColor( ImplWinColorToSal( GetSysColor( COLOR_WINDOW ) ) );
+ aStyleSettings.SetActiveTabColor( aStyleSettings.GetWindowColor() );
aStyleSettings.SetWindowTextColor( ImplWinColorToSal( GetSysColor( COLOR_WINDOWTEXT ) ) );
aStyleSettings.SetFieldColor( aStyleSettings.GetWindowColor() );
aStyleSettings.SetFieldTextColor( aStyleSettings.GetWindowTextColor() );
@@ -5685,6 +5694,91 @@ static void ImplHandleIMENotify( HWND hWnd, WPARAM wParam )
}
// -----------------------------------------------------------------------
+#if WINVER >= 0x0500
+
+static LRESULT ImplHandleIMEReconvertString( HWND hWnd, LPARAM lParam )
+{
+ WinSalFrame* pFrame = GetWindowPtr( hWnd );
+ LPRECONVERTSTRING pReconvertString = (LPRECONVERTSTRING) lParam;
+ LRESULT nRet = 0;
+ SalSurroundingTextRequestEvent aEvt;
+ aEvt.maText = UniString();
+ aEvt.mnStart = aEvt.mnEnd = 0;
+
+ UINT nImeProps = ImmGetProperty( GetKeyboardLayout( 0 ), IGP_SETCOMPSTR );
+ if( (nImeProps & SCS_CAP_SETRECONVERTSTRING) == 0 )
+ {
+ // This IME does not support reconversion.
+ return 0;
+ }
+
+ if( !pReconvertString )
+ {
+ // The first call for reconversion.
+ pFrame->CallCallback( SALEVENT_STARTRECONVERSION, (void*)NULL );
+
+ // Retrieve the surrounding text from the focused control.
+ pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTREQUEST, (void*)&aEvt );
+
+ if( aEvt.maText.Len() == 0 )
+ {
+ return 0;
+ }
+
+ nRet = sizeof(RECONVERTSTRING) + (aEvt.maText.Len() + 1) * sizeof(WCHAR);
+ }
+ else
+ {
+ // The second call for reconversion.
+
+ // Retrieve the surrounding text from the focused control.
+ pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTREQUEST, (void*)&aEvt );
+ nRet = sizeof(RECONVERTSTRING) + (aEvt.maText.Len() + 1) * sizeof(WCHAR);
+
+ pReconvertString->dwStrOffset = sizeof(RECONVERTSTRING);
+ pReconvertString->dwStrLen = aEvt.maText.Len();
+ pReconvertString->dwCompStrOffset = aEvt.mnStart * sizeof(WCHAR);
+ pReconvertString->dwCompStrLen = aEvt.mnEnd - aEvt.mnStart;
+ pReconvertString->dwTargetStrOffset = pReconvertString->dwCompStrOffset;
+ pReconvertString->dwTargetStrLen = pReconvertString->dwCompStrLen;
+
+ memcpy( (LPWSTR)(pReconvertString + 1), aEvt.maText.GetBuffer(), (aEvt.maText.Len() + 1) * sizeof(WCHAR) );
+ }
+
+ // just return the required size of buffer to reconvert.
+ return nRet;
+}
+
+// -----------------------------------------------------------------------
+
+static LRESULT ImplHandleIMEConfirmReconvertString( HWND hWnd, LPARAM lParam )
+{
+ WinSalFrame* pFrame = GetWindowPtr( hWnd );
+ LPRECONVERTSTRING pReconvertString = (LPRECONVERTSTRING) lParam;
+ SalSurroundingTextRequestEvent aEvt;
+ aEvt.maText = UniString();
+ aEvt.mnStart = aEvt.mnEnd = 0;
+
+ pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTREQUEST, (void*)&aEvt );
+
+ ULONG nTmpStart = pReconvertString->dwCompStrOffset / sizeof(WCHAR);
+ ULONG nTmpEnd = nTmpStart + pReconvertString->dwCompStrLen;
+
+ if( nTmpStart != aEvt.mnStart || nTmpEnd != aEvt.mnEnd )
+ {
+ SalSurroundingTextSelectionChangeEvent aSelEvt;
+ aSelEvt.mnStart = nTmpStart;
+ aSelEvt.mnEnd = nTmpEnd;
+
+ pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTSELECTIONCHANGE, (void*)&aSelEvt );
+ }
+
+ return TRUE;
+}
+
+#endif // WINVER >= 0x0500
+
+// -----------------------------------------------------------------------
void SalTestMouseLeave()
{
@@ -6100,10 +6194,23 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
case WM_IME_NOTIFY:
ImplHandleIMENotify( hWnd, wParam );
break;
-
case WM_APPCOMMAND:
ImplHandleAppCommand( hWnd, lParam );
break;
+#if WINVER >= 0x0500
+ case WM_IME_REQUEST:
+ if ( PtrToInt( wParam ) == IMR_RECONVERTSTRING )
+ {
+ nRet = ImplHandleIMEReconvertString( hWnd, lParam );
+ rDef = FALSE;
+ }
+ else if( PtrToInt( wParam ) == IMR_CONFIRMRECONVERTSTRING )
+ {
+ nRet = ImplHandleIMEConfirmReconvertString( hWnd, lParam );
+ rDef = FALSE;
+ }
+ break;
+#endif // WINVER >= 0x0500
}
// WheelMouse-Message abfangen