Kaydet (Commit) b26b6cab authored tarafından Jim Raykowski's avatar Jim Raykowski

tdf#119775 Make keyboard use work for TableWindow popup window

This patch restores the ability to use the keyboard for the TableWindow
popup window by not including the 'More Options...' button when
activated by keyboard from a toolbox. It also limits handling of key
input to SPACE, RETURN, and ESCAPE key input when mouse activated.

Change-Id: I306bcb844a829ca7067b8496f37cb68f35fa754d
Reviewed-on: https://gerrit.libreoffice.org/71813
Tested-by: Jenkins
Reviewed-by: 's avatarJim Raykowski <raykowj@gmail.com>
üst 5c8de864
......@@ -84,6 +84,7 @@ public:
virtual void MouseButtonUp( const MouseEvent& rMEvt ) override;
virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const tools::Rectangle& ) override;
virtual void PopupModeEnd() override;
virtual bool EventNotify( NotifyEvent& rNEvt ) override;
private:
void Update( long nNewCol, long nNewLine );
......@@ -137,13 +138,22 @@ TableWindow::TableWindow( sal_uInt16 nSlotId, vcl::Window* pParent, const OUStri
SetText( rText );
aTableButton->SetPosSizePixel( Point( nTablePosX, mnTableHeight + 5 ),
Size( mnTableWidth - nTablePosX, 24 ) );
aTableButton->SetText( SvxResId( RID_SVXSTR_MORE ) );
aTableButton->SetClickHdl( LINK( this, TableWindow, SelectHdl ) );
aTableButton->Show();
// if parent window is a toolbox only display table button when mouse activated
ToolBox* pToolBox = nullptr;
if (pParent->GetType() == WindowType::TOOLBOX)
pToolBox = dynamic_cast<ToolBox*>( pParent );
if ( !pToolBox || !pToolBox->IsKeyEvent() )
{
aTableButton->SetPosSizePixel( Point( nTablePosX, mnTableHeight + 5 ),
Size( mnTableWidth - nTablePosX, 24 ) );
aTableButton->SetText( SvxResId( RID_SVXSTR_MORE ) );
aTableButton->SetClickHdl( LINK( this, TableWindow, SelectHdl ) );
aTableButton->Show();
SetOutputSizePixel( Size( mnTableWidth + 3, mnTableHeight + 33 ) );
SetOutputSizePixel( Size( mnTableWidth + 3, mnTableHeight + 33 ) );
}
else
SetOutputSizePixel( Size( mnTableWidth + 3, mnTableHeight + 3 ) );
}
......@@ -375,6 +385,21 @@ void TableWindow::CloseAndShowTableDialog()
TableDialog( Sequence< PropertyValue >() );
}
bool TableWindow::EventNotify( NotifyEvent& rNEvt )
{
// handle table button key input
if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
{
const vcl::KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode();
const sal_uInt16 nCode = rKey.GetCode();
if ( nCode != KEY_RETURN && nCode != KEY_SPACE && nCode != KEY_ESCAPE )
{
return true;
}
}
return SfxPopupWindow::EventNotify( rNEvt );
}
class ColumnsWindow : public SfxPopupWindow
{
private:
......
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