Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #37

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
all select
Change-Id: If2d292ab562bd2f89c872bc7ba13c681583ee604
  • Loading branch information
yuji3333 committed Oct 24, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit f77eef0049a71d89611606d5bed53f4e4d651b21
1 change: 1 addition & 0 deletions include/vcl/toolbox.hxx
Original file line number Diff line number Diff line change
@@ -270,6 +270,7 @@ public:
virtual void Select();

virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
void MouseButtonDown2( const MouseEvent& rMEvt );
virtual void MouseButtonUp( const MouseEvent& rMEvt ) override;
virtual void MouseMove( const MouseEvent& rMEvt ) override;
virtual void Tracking( const TrackingEvent& rTEvt ) override;
1 change: 1 addition & 0 deletions sw/source/core/undo/docundo.cxx
Original file line number Diff line number Diff line change
@@ -53,6 +53,7 @@ using namespace ::com::sun::star;

namespace sw {


UndoManager::UndoManager(std::shared_ptr<SwNodes> xUndoNodes,
IDocumentDrawModelAccess & rDrawModelAccess,
IDocumentRedlineAccess & rRedlineAccess,
196 changes: 196 additions & 0 deletions vcl/source/window/toolbox.cxx
Original file line number Diff line number Diff line change
@@ -3108,6 +3108,11 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt )
{
if ( (item.meType == ToolBoxItemType::BUTTON) && item.mbEnabled )
{
// if ((nTempPos == 25) || (nTempPos == 26)){
// return this->MouseButtonDown2(rMEvt);
// }
return this->MouseButtonDown2(rMEvt);

bClearHigh = false;
if ( mnHighItemId != item.mnId )
{
@@ -3365,6 +3370,197 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt )
DockingWindow::MouseButtonDown( rMEvt );
}

void ToolBox::MouseButtonDown2( const MouseEvent& rMEvt )
{
// only trigger toolbox for left mouse button and when
// we're not in normal operation
if (!mbDrag && (mnCurPos == ITEM_NOTFOUND) )
{
// call activate already here, as items could
// be exchanged
Activate();

// update ToolBox here, such that user knows it
if ( mbFormat )
{
ImplFormat();
PaintImmediately();
}

Point aMousePos = rMEvt.GetPosPixel();
ImplToolItems::size_type i = 0;
ImplToolItems::size_type nNewPos = ITEM_NOTFOUND;

// search for item that was clicked
for (auto const& item : mpData->m_aItems)
{
// is this the item?
if ( item.maRect.Contains( aMousePos ) )
{
// do nothing if it is a separator or
// if the item has been disabled
if ( (item.meType == ToolBoxItemType::BUTTON) &&
!item.mbShowWindow )
nNewPos = i;

break;
}

i++;
}

// item found
if ( nNewPos != ITEM_NOTFOUND )
{
if ( !mpData->m_aItems[nNewPos].mbEnabled )
{
Deactivate();
return;
}

// update actual data
StartTrackingFlags nTrackFlags = StartTrackingFlags::NONE;
mnCurPos = i;
mnCurItemId = mpData->m_aItems[nNewPos].mnId;
mnDownItemId = mnCurItemId;
mnMouseModifier = rMEvt.GetModifier();
if ( mpData->m_aItems[nNewPos].mnBits & ToolBoxItemBits::REPEAT )
nTrackFlags |= StartTrackingFlags::ButtonRepeat;

// update bDrag here, as it is evaluated in the EndSelection
mbDrag = true;

// on double-click: only call the handler, but do so before the button
// is hit, as in the handler dragging
// can be terminated
if ( rMEvt.GetClicks() == 2 )
DoubleClick();

if ( mbDrag )
{
InvalidateItem(mnCurPos);
Highlight();
}

// was dropdown arrow pressed
if( mpData->m_aItems[nNewPos].mnBits & ToolBoxItemBits::DROPDOWN )
{
if( ( (mpData->m_aItems[nNewPos].mnBits & ToolBoxItemBits::DROPDOWNONLY) == ToolBoxItemBits::DROPDOWNONLY)
|| mpData->m_aItems[nNewPos].GetDropDownRect( mbHorz ).Contains( aMousePos ))
{
// dropdownonly always triggers the dropdown handler, over the whole button area

// the drop down arrow should not trigger the item action
mpData->mbDropDownByKeyboard = false;
mpData->maDropdownClickHdl.Call( this );

// do not reset data if the dropdown handler opened a floating window
// see ImplFloatControl()
if( !mpFloatWin )
{
// no floater was opened
Deactivate();
InvalidateItem(mnCurPos);

mnCurPos = ITEM_NOTFOUND;
mnCurItemId = ToolBoxItemId(0);
mnDownItemId = ToolBoxItemId(0);
mnMouseModifier = 0;
mnHighItemId = ToolBoxItemId(0);
}
return;
}
else // activate long click timer
mpData->maDropdownTimer.Start();
}

// call Click handler
if ( rMEvt.GetClicks() != 2 )
Click();

// also call Select handler at repeat
if ( nTrackFlags & StartTrackingFlags::ButtonRepeat )
Select();

// if the actions was not aborted in Click handler
if ( mbDrag )
StartTracking( nTrackFlags );

// if mouse was clicked over an item we
// can abort here
return;
}

Deactivate();

// menu button hit ?
if( mpData->maMenubuttonItem.maRect.Contains( aMousePos ) && ImplHasClippedItems() )
{
if ( maMenuButtonHdl.IsSet() )
maMenuButtonHdl.Call( this );
else
ExecuteCustomMenu( mpData->maMenubuttonItem.maRect );
return;
}

// check scroll- and next-buttons here
if ( maUpperRect.Contains( aMousePos ) )
{
if ( mnCurLine > 1 )
{
StartTracking();
mbUpper = true;
mbIn = true;
InvalidateSpin(true, false);
}
return;
}
if ( maLowerRect.Contains( aMousePos ) )
{
if ( mnCurLine+mnVisLines-1 < mnCurLines )
{
StartTracking();
mbLower = true;
mbIn = true;
InvalidateSpin(false);
}
return;
}

// Linesizing testen
if ( (mnWinStyle & TB_WBLINESIZING) == TB_WBLINESIZING )
{
sal_uInt16 nLineMode = ImplTestLineSize( aMousePos );
if ( nLineMode )
{
ImplTBDragMgr* pMgr = ImplGetTBDragMgr();

// call handler, such that we can set the
// dock rectangles
StartDocking();

Point aPos = GetParent()->OutputToScreenPixel( GetPosPixel() );
Size aSize = GetSizePixel();
aPos = ScreenToOutputPixel( aPos );

// start dragging
pMgr->StartDragging( this, aMousePos, tools::Rectangle( aPos, aSize ),
nLineMode );
return;
}
}

// no item, then only click or double click
if ( rMEvt.GetClicks() == 2 )
DoubleClick();
else
Click();
}

if ( !mbDrag && (mnCurPos == ITEM_NOTFOUND) )
DockingWindow::MouseButtonDown( rMEvt );
}

void ToolBox::MouseButtonUp( const MouseEvent& rMEvt )
{
if ( ImplHandleMouseButtonUp( rMEvt ) )