diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2008-04-24 13:01:33 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2008-04-24 13:01:33 +0000 |
commit | 01984a19cbca37af9cc1f17c8acf1d5e929e04f8 (patch) | |
tree | 7010a114c9100435d9cbf646531ef3cec1f9d185 /starmath | |
parent | 71e9a4858d09672f97d61cb6a3d2b7804de2b861 (diff) |
INTEGRATION: CWS tl50 (1.51.40); FILE MERGED
2008/03/07 12:47:16 tl 1.51.40.1: #i85449# initial focus problem fixed by using timer
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/view.cxx | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index cf126e3cf1e5..4ff1904ffb0d 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: view.cxx,v $ - * $Revision: 1.52 $ + * $Revision: 1.53 $ * * This file is part of OpenOffice.org. * @@ -220,9 +220,6 @@ void SmGraphicWindow::MouseButtonDown(const MouseEvent& rMEvt) void SmGraphicWindow::GetFocus() { - SmEditWindow *pEditWin = pViewShell ? pViewShell->GetEditWindow() : 0; - if (pEditWin) - pEditWin->GrabFocus(); /* if (xAccessible.is()) { @@ -516,11 +513,15 @@ SmCmdBoxWindow::SmCmdBoxWindow(SfxBindings *pBindings_, SfxChildWindow *pChildWi bExiting (FALSE) { Hide (); + + aInitialFocusTimer.SetTimeoutHdl(LINK(this, SmCmdBoxWindow, InitialFocusTimerHdl)); + aInitialFocusTimer.SetTimeout(100); } SmCmdBoxWindow::~SmCmdBoxWindow () { + aInitialFocusTimer.Stop(); bExiting = TRUE; } @@ -642,14 +643,26 @@ void SmCmdBoxWindow::StateChanged( StateChangedType nStateChange ) if (TRUE == IsFloatingMode()) AdjustPosition(); //! don't change pos in docking-mode ! - // make sure the formula can be edited right away - aEdit.GrabFocus(); +// // make sure the formula can be edited right away +// aEdit.GrabFocus(); + + // grab focus as above does not work... + // Thus we implement a timer based solution to get the inital + // focus in the Edit window. + aInitialFocusTimer.Start(); } SfxDockingWindow::StateChanged( nStateChange ); } +IMPL_LINK( SmCmdBoxWindow, InitialFocusTimerHdl, Timer *, EMPTYARG /*pTimer*/ ) +{ + aEdit.GrabFocus(); + return 0; +} + + void SmCmdBoxWindow::AdjustPosition() { Point aPt; |