summaryrefslogtreecommitdiff
path: root/include/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-03-26 16:27:17 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-03-28 22:07:06 +0100
commit3e078e17ee2144fb976a7e6b9227152113cea0d4 (patch)
tree01faab7d3c82c5b027b42a6722700736b249a775 /include/vcl
parent1e2868296730d3548574f61a3c6e323aa5c0598a (diff)
weld SfxTemplateManagerDlg
like expert configuration change the gear menu not to display a down indicator and use CommandEvent to distinguish mouse/non-mouse context menus Change-Id: I64bb660a9c7dacb5b90b240d9d76d29324c5fd9f Reviewed-on: https://gerrit.libreoffice.org/69893 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/vcl')
-rw-r--r--include/vcl/customweld.hxx8
-rw-r--r--include/vcl/layout.hxx6
-rw-r--r--include/vcl/weld.hxx22
3 files changed, 26 insertions, 10 deletions
diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx
index db60521a195d..e8bbb2129912 100644
--- a/include/vcl/customweld.hxx
+++ b/include/vcl/customweld.hxx
@@ -33,7 +33,7 @@ public:
virtual void GetFocus() {}
virtual void LoseFocus() {}
virtual void StyleUpdated() { Invalidate(); }
- virtual bool ContextMenu(const Point&) { return false; }
+ virtual bool ContextMenu(const CommandEvent&) { return false; }
virtual bool KeyInput(const KeyEvent&) { return false; }
virtual tools::Rectangle GetFocusRect() { return tools::Rectangle(); }
virtual FactoryFunction GetUITestFactory() const { return nullptr; }
@@ -49,8 +49,8 @@ public:
m_pDrawingArea->queue_draw_area(rRect.Left(), rRect.Top(), rRect.GetWidth(),
rRect.GetHeight());
}
- void Show() { m_pDrawingArea->show(); }
- void Hide() { m_pDrawingArea->hide(); }
+ virtual void Show() { m_pDrawingArea->show(); }
+ virtual void Hide() { m_pDrawingArea->hide(); }
void GrabFocus() { m_pDrawingArea->grab_focus(); }
bool HasFocus() const { return m_pDrawingArea->has_focus(); }
bool IsVisible() const { return m_pDrawingArea->get_visible(); }
@@ -101,7 +101,7 @@ private:
DECL_LINK(DoLoseFocus, weld::Widget&, void);
DECL_LINK(DoKeyPress, const KeyEvent&, bool);
DECL_LINK(DoFocusRect, weld::Widget&, tools::Rectangle);
- DECL_LINK(DoPopupMenu, const Point&, bool);
+ DECL_LINK(DoPopupMenu, const CommandEvent&, bool);
DECL_LINK(DoStyleUpdated, weld::Widget&, void);
DECL_LINK(DoRequestHelp, tools::Rectangle&, OUString);
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 33a6db730a85..2ea881a31fd6 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -620,7 +620,7 @@ private:
Link<const KeyEvent&, bool> m_aKeyPressHdl;
Link<const KeyEvent&, bool> m_aKeyReleaseHdl;
Link<VclDrawingArea&, void> m_aStyleUpdatedHdl;
- Link<const Point&, bool> m_aPopupMenuHdl;
+ Link<const CommandEvent&, bool> m_aPopupMenuHdl;
Link<tools::Rectangle&, OUString> m_aQueryTooltipHdl;
virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override
@@ -677,7 +677,7 @@ private:
}
virtual void Command(const CommandEvent& rEvent) override
{
- if (rEvent.GetCommand() == CommandEventId::ContextMenu && m_aPopupMenuHdl.Call(rEvent.GetMousePosPixel()))
+ if (rEvent.GetCommand() == CommandEventId::ContextMenu && m_aPopupMenuHdl.Call(rEvent))
return;
Control::Command(rEvent);
}
@@ -755,7 +755,7 @@ public:
{
m_aStyleUpdatedHdl = rLink;
}
- void SetPopupMenuHdl(const Link<const Point&, bool>& rLink)
+ void SetPopupMenuHdl(const Link<const CommandEvent&, bool>& rLink)
{
m_aPopupMenuHdl = rLink;
}
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 91fc19f65a87..f258b83c2cd5 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -254,6 +254,8 @@ public:
virtual int hadjustment_get_upper() const = 0;
virtual void hadjustment_set_upper(int upper) = 0;
virtual int hadjustment_get_page_size() const = 0;
+ virtual void hadjustment_set_page_size(int size) = 0;
+ virtual void hadjustment_set_page_increment(int size) = 0;
virtual void set_hpolicy(VclPolicyType eHPolicy) = 0;
virtual VclPolicyType get_hpolicy() const = 0;
void connect_hadjustment_changed(const Link<ScrolledWindow&, void>& rLink)
@@ -270,6 +272,8 @@ public:
virtual int vadjustment_get_upper() const = 0;
virtual void vadjustment_set_upper(int upper) = 0;
virtual int vadjustment_get_page_size() const = 0;
+ virtual void vadjustment_set_page_size(int size) = 0;
+ virtual void vadjustment_set_page_increment(int size) = 0;
virtual int vadjustment_get_lower() const = 0;
virtual void vadjustment_set_lower(int upper) = 0;
virtual void set_vpolicy(VclPolicyType eVPolicy) = 0;
@@ -852,11 +856,14 @@ public:
{
insert_item(-1, rId, rStr, nullptr, &rImage, false);
}
+ virtual void insert_separator(int pos, const OUString& rId) = 0;
+ void append_separator(const OUString& rId) { insert_separator(-1, rId); }
virtual void remove_item(const OString& rId) = 0;
virtual void set_item_sensitive(const OString& rIdent, bool bSensitive) = 0;
virtual void set_item_active(const OString& rIdent, bool bActive) = 0;
virtual void set_item_label(const OString& rIdent, const OUString& rLabel) = 0;
virtual void set_item_help_id(const OString& rIdent, const OString& rHelpId) = 0;
+ virtual void set_item_visible(const OString& rIdent, bool bVisible) = 0;
virtual OString get_item_help_id(const OString& rIdent) const = 0;
virtual void set_popover(weld::Widget* pPopover) = 0;
@@ -1474,7 +1481,7 @@ public:
protected:
Link<draw_args, void> m_aDrawHdl;
Link<Widget&, void> m_aStyleUpdatedHdl;
- Link<const Point&, bool> m_aPopupMenuHdl;
+ Link<const CommandEvent&, bool> m_aPopupMenuHdl;
Link<Widget&, tools::Rectangle> m_aGetFocusRectHdl;
Link<tools::Rectangle&, OUString> m_aQueryTooltipHdl;
@@ -1486,7 +1493,10 @@ protected:
public:
void connect_draw(const Link<draw_args, void>& rLink) { m_aDrawHdl = rLink; }
void connect_style_updated(const Link<Widget&, void>& rLink) { m_aStyleUpdatedHdl = rLink; }
- void connect_popup_menu(const Link<const Point&, bool>& rLink) { m_aPopupMenuHdl = rLink; }
+ void connect_popup_menu(const Link<const CommandEvent&, bool>& rLink)
+ {
+ m_aPopupMenuHdl = rLink;
+ }
void connect_focus_rect(const Link<Widget&, tools::Rectangle>& rLink)
{
m_aGetFocusRectHdl = rLink;
@@ -1512,11 +1522,17 @@ public:
virtual OString popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect) = 0;
virtual void set_sensitive(const OString& rIdent, bool bSensitive) = 0;
virtual void set_active(const OString& rIdent, bool bActive) = 0;
- virtual void show(const OString& rIdent, bool bShow) = 0;
+ virtual void set_visible(const OString& rIdent, bool bVisible) = 0;
virtual void insert(int pos, const OUString& rId, const OUString& rStr,
const OUString* pIconName, VirtualDevice* pImageSufface, bool bCheck)
= 0;
+
+ virtual void clear() = 0;
+
+ virtual void insert_separator(int pos, const OUString& rId) = 0;
+ void append_separator(const OUString& rId) { insert_separator(-1, rId); }
+
void append(const OUString& rId, const OUString& rStr)
{
insert(-1, rId, rStr, nullptr, nullptr, false);