Kaydet (Commit) 2fdcd86a authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

tdf#65587 SM add key navigation to ElementControl

This adds arrows + home + end key navigation.

The grid is handled like a list. For convenience Left + Up
and Right + Down keys work in the same way.

Change-Id: I757184e5161f2c7ac9b241294a5edc304c882497
Reviewed-on: https://gerrit.libreoffice.org/72792
Tested-by: Jenkins
Reviewed-by: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst a71c9607
......@@ -78,22 +78,28 @@ class SmElementsControl : public Control
virtual void MouseMove(const MouseEvent& rMEvt) override;
virtual void RequestHelp(const HelpEvent& rHEvt) override;
virtual void Resize() override;
virtual void GetFocus() override;
virtual void LoseFocus() override;
virtual void KeyInput(const KeyEvent& rKEvt) override;
SmDocShell* mpDocShell;
SmFormat maFormat;
OString msCurrentSetId;
SmElement* mpCurrentElement;
sal_uInt16 m_nCurrentElement;
sal_uInt16 m_nCurrentRolloverElement;
Link<SmElement&,void> maSelectHdlLink;
std::vector< std::unique_ptr<SmElement> > maElementList;
Size maMaxElementDimensions;
bool mbVerticalMode;
VclPtr< ScrollBar > mxScroll;
bool mbFirstPaintAfterLayout;
bool m_bFirstPaintAfterLayout;
void addElement(const OUString& aElementVisual, const OUString& aElementSource, const OUString& aHelpText);
void addElements(const std::pair<const char*, const char*> aElementsArray[], sal_uInt16 size);
SmElement* current() const;
bool hasRollover() const { return m_nCurrentRolloverElement != SAL_MAX_UINT16; }
void stepFocus(const bool bBackward);
void build();
......@@ -62,7 +62,7 @@ StringMap ElementSelectorUIObject::get_state()
StringMap aMap = WindowUIObject::get_state();
SmElement* pElement = mxElementsSelector->mpCurrentElement;
SmElement* pElement = mxElementsSelector->current();
if (pElement)
aMap["CurrentEntry"] = pElement->getText();
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