Kaydet (Commit) 8c7c9465 authored tarafından Gregor Hartmann's avatar Gregor Hartmann

#i31221# #i31229#fix tear-off and context-menu for toolboxes

üst 0348cd8b
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: statemnt.cxx,v $ * $RCSfile: statemnt.cxx,v $
* *
* $Revision: 1.11 $ * $Revision: 1.12 $
* *
* last change: $Author: obo $ $Date: 2004-07-07 13:47:00 $ * last change: $Author: gh $ $Date: 2004-07-09 07:42:13 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -4025,21 +4025,32 @@ BOOL StatementControl::HandleCommonMethods( Window *pControl ) ...@@ -4025,21 +4025,32 @@ BOOL StatementControl::HandleCommonMethods( Window *pControl )
aSubMenuId2 = SmartId(); aSubMenuId2 = SmartId();
pMenuWindow = NULL; pMenuWindow = NULL;
Point aPos; Point aPos;
BOOL bAtMousePos = ( nParams & PARAM_BOOL_1 ) && bBool1; ToolBox* pTB;
if ( bAtMousePos ) if ( (pControl->GetType() == WINDOW_TOOLBOX) ? (pTB = (ToolBox*)pControl)->IsMenuEnabled() : FALSE )
{ {
aPos = pControl->GetPointerPosPixel(); Rectangle aRect = pTB->GetMenubuttonRect();
Window *pActualWin = pControl->FindWindow( aPos ); AnimateMouse( pControl, aRect.Center() );
MouseEvent aMEvnt(aRect.Center(),1,MOUSE_SIMPLECLICK,MOUSE_LEFT);
if ( pActualWin ) ImplMouseButtonDown( pTB, aMEvnt );
}
else
{
BOOL bAtMousePos = ( nParams & PARAM_BOOL_1 ) && bBool1;
if ( bAtMousePos )
{ {
aPos = pActualWin->AbsoluteScreenToOutputPixel( pControl->OutputToAbsoluteScreenPixel ( aPos ) ); aPos = pControl->GetPointerPosPixel();
// aPos = pActualWin->ScreenToOutputPixel( pControl->OutputToScreenPixel ( aPos ) ); Window *pActualWin = pControl->FindWindow( aPos );
pControl = pActualWin;
if ( pActualWin )
{
aPos = pActualWin->AbsoluteScreenToOutputPixel( pControl->OutputToAbsoluteScreenPixel ( aPos ) );
// aPos = pActualWin->ScreenToOutputPixel( pControl->OutputToScreenPixel ( aPos ) );
pControl = pActualWin;
}
} }
CommandEvent aEvent( aPos, COMMAND_CONTEXTMENU, bAtMousePos );
ImplCommand( pControl, aEvent );
} }
CommandEvent aEvent( aPos, COMMAND_CONTEXTMENU, bAtMousePos );
ImplCommand( pControl, aEvent );
} }
break; break;
case M_UseMenu: case M_UseMenu:
...@@ -5041,22 +5052,13 @@ BOOL StatementControl::Execute() ...@@ -5041,22 +5052,13 @@ BOOL StatementControl::Execute()
FIND_HELP; FIND_HELP;
if ( bBool1 ) // FIND_HELP Erfolgreich if ( bBool1 ) // FIND_HELP Erfolgreich
{ {
Rectangle aRect = pTB->GetItemRect(pTB->GetItemId(nNr1)); Rectangle aRect = pTB->GetItemPosDropDownRect( nNr1 );
AnimateMouse( pControl, aRect.Center() ); AnimateMouse( pControl, aRect.Center() );
MouseEvent aMEvnt(aRect.Center(),1,MOUSE_SIMPLECLICK,MOUSE_LEFT); MouseEvent aMEvnt(aRect.Center(),1,MOUSE_SIMPLECLICK,MOUSE_LEFT);
ImplMouseButtonDown( pTB, aMEvnt ); ImplMouseButtonDown( pTB, aMEvnt );
Window *pWin = NULL; Window *pWin = NULL;
StatementList::bExecuting = TRUE; // Bah ist das ein ekliger Hack // Wait for the window to open.
{ // Das verhindert, da schon der nchste Befehl ausgefhrt wird.
ULONG nStart = Time::GetSystemTicks();
ULONG nDelay = pControl->GetSettings().GetMouseSettings().GetActionDelay();
while ( !(pWin = GetPopupFloatingWin()) && ( Time::GetSystemTicks() - nStart ) < nDelay + 100 )
SafeReschedule();
}
StatementList::bExecuting = FALSE; // Bah ist das ein ekliger Hack
// Das Fenster ist offen.
StatementList::bExecuting = TRUE; // Bah ist das ein ekliger Hack StatementList::bExecuting = TRUE; // Bah ist das ein ekliger Hack
{ // Das verhindert, da schon der nchste Befehl ausgefhrt wird. { // Das verhindert, da schon der nchste Befehl ausgefhrt wird.
Time aDelay; Time aDelay;
...@@ -5065,7 +5067,7 @@ BOOL StatementControl::Execute() ...@@ -5065,7 +5067,7 @@ BOOL StatementControl::Execute()
} }
StatementList::bExecuting = FALSE; // Bah ist das ein ekliger Hack StatementList::bExecuting = FALSE; // Bah ist das ein ekliger Hack
if ( pWin ) if ( pWin && pWin->GetType() == WINDOW_FLOATINGWINDOW )
{ {
MouseEvent aMEvnt(aRect.Center(),1,MOUSE_SIMPLECLICK,MOUSE_LEFT); MouseEvent aMEvnt(aRect.Center(),1,MOUSE_SIMPLECLICK,MOUSE_LEFT);
ImplMouseButtonUp( pTB, aMEvnt ); ImplMouseButtonUp( pTB, aMEvnt );
...@@ -5085,20 +5087,11 @@ BOOL StatementControl::Execute() ...@@ -5085,20 +5087,11 @@ BOOL StatementControl::Execute()
FIND_HELP; FIND_HELP;
if ( bBool1 ) // FIND_HELP Erfolgreich if ( bBool1 ) // FIND_HELP Erfolgreich
{ {
Rectangle aRect = pTB->GetItemRect(pTB->GetItemId(nNr1)); Rectangle aRect = pTB->GetItemPosDropDownRect( nNr1 );
AnimateMouse( pControl, aRect.Center() ); AnimateMouse( pControl, aRect.Center() );
MouseEvent aMEvnt(aRect.Center(),1,MOUSE_SIMPLECLICK,MOUSE_LEFT); MouseEvent aMEvnt(aRect.Center(),1,MOUSE_SIMPLECLICK,MOUSE_LEFT);
ImplMouseButtonDown( pTB, aMEvnt ); ImplMouseButtonDown( pTB, aMEvnt );
StatementList::bExecuting = TRUE; // Bah ist das ein ekliger Hack
{ // Das verhindert, da schon der nchste Befehl ausgefhrt wird.
ULONG nStart = Time::GetSystemTicks();
ULONG nDelay = pControl->GetSettings().GetMouseSettings().GetActionDelay();
while ( ( Time::GetSystemTicks() - nStart ) < nDelay + 100 )
SafeReschedule();
}
StatementList::bExecuting = FALSE; // Bah ist das ein ekliger Hack
// Das Fenster ist offen. // Das Fenster ist offen.
aSubMenuId1 = SmartId(); aSubMenuId1 = SmartId();
aSubMenuId2 = SmartId(); aSubMenuId2 = SmartId();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment