weld: Move weld::MenuButton to own header
Move the class out of weld.hxx into its own header, in order to make it easier to keep an overview and to avoid having to recompile ~all UI code when the class is modified. Change-Id: I47ea75ca8aedc7409a262fc72afcfbc0accef4ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199050 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <vcl/weld/Builder.hxx>
|
||||
#include <vcl/weld/Entry.hxx>
|
||||
#include <vcl/weld/DialogController.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/ScrolledWindow.hxx>
|
||||
#include <vcl/weld/weld.hxx>
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <editeng/SpellPortions.hxx>
|
||||
#include <vcl/weld/ComboBox.hxx>
|
||||
#include <vcl/weld/DrawingArea.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/ScrolledWindow.hxx>
|
||||
#include <vcl/weld/Toolbar.hxx>
|
||||
#include <vcl/weld/TreeView.hxx>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <vcl/weld/ComboBox.hxx>
|
||||
#include <vcl/weld/DialogController.hxx>
|
||||
#include <vcl/weld/Entry.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/TextView.hxx>
|
||||
#include <vcl/weld/TreeView.hxx>
|
||||
#include <vcl/weld/weld.hxx>
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <tools/fldunit.hxx>
|
||||
#include <vcl/weld/Entry.hxx>
|
||||
#include <vcl/weld/Menu.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/SpinButton.hxx>
|
||||
#include <vcl/weld/customweld.hxx>
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <svx/numberingpreview.hxx>
|
||||
#include <vcl/weld/Entry.hxx>
|
||||
#include <vcl/weld/Menu.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/MetricSpinButton.hxx>
|
||||
#include <vcl/weld/SpinButton.hxx>
|
||||
#include <vcl/weld/TreeView.hxx>
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <com/sun/star/container/XNameAccess.hpp>
|
||||
#include <vcl/graph.hxx>
|
||||
#include <vcl/GraphicObject.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/TreeView.hxx>
|
||||
#include <vcl/weld/customweld.hxx>
|
||||
#include <vcl/weld/weld.hxx>
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <svx/colorbox.hxx>
|
||||
#include <vcl/weld/Entry.hxx>
|
||||
#include <vcl/weld/FormattedSpinButton.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/MetricSpinButton.hxx>
|
||||
#include <vcl/weld/TextView.hxx>
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <vcl/errinf.hxx>
|
||||
#include <vcl/windowstate.hxx>
|
||||
#include <vcl/vclenum.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <officecfg/Office/Common.hxx>
|
||||
|
||||
using namespace ::svt;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <vcl/InterimItemWindow.hxx>
|
||||
#include <vcl/weld/Builder.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/Toolbar.hxx>
|
||||
|
||||
#include <com/sun/star/graphic/XGraphic.hpp>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <vcl/weld/ComboBox.hxx>
|
||||
#include <vcl/weld/DialogController.hxx>
|
||||
#include <vcl/weld/Entry.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/TreeView.hxx>
|
||||
#include <vcl/weld/weld.hxx>
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <vcl/metric.hxx>
|
||||
#include <vcl/weld/Builder.hxx>
|
||||
#include <vcl/weld/ComboBox.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/weld.hxx>
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <vcl/weld/ComboBox.hxx>
|
||||
#include <vcl/weld/Entry.hxx>
|
||||
#include <vcl/weld/FormattedSpinButton.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/TextView.hxx>
|
||||
#include <vcl/weld/weldutils.hxx>
|
||||
#include <o3tl/typed_flags_set.hxx>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#define INCLUDED_SVX_COLORBOX_HXX
|
||||
|
||||
#include <memory>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/weld.hxx>
|
||||
#include <svx/colorwindow.hxx>
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <vcl/weld/FormattedSpinButton.hxx>
|
||||
#include <vcl/weld/IconView.hxx>
|
||||
#include <vcl/weld/Menu.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/Notebook.hxx>
|
||||
#include <vcl/weld/ScrolledWindow.hxx>
|
||||
#include <vcl/weld/SpinButton.hxx>
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
||||
/*
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vcl/dllapi.h>
|
||||
#include <vcl/weld/weld.hxx>
|
||||
|
||||
namespace weld
|
||||
{
|
||||
class VCL_DLLPUBLIC MenuButton : virtual public ToggleButton
|
||||
{
|
||||
friend class ::LOKTrigger;
|
||||
|
||||
Link<const OUString&, void> m_aSelectHdl;
|
||||
|
||||
protected:
|
||||
void signal_selected(const OUString& rIdent) { m_aSelectHdl.Call(rIdent); }
|
||||
|
||||
public:
|
||||
void connect_selected(const Link<const OUString&, void>& rLink) { m_aSelectHdl = rLink; }
|
||||
|
||||
virtual void insert_item(int pos, const OUString& rId, const OUString& rStr,
|
||||
const OUString* pIconName, VirtualDevice* pImageSurface,
|
||||
TriState eCheckRadioFalse)
|
||||
= 0;
|
||||
void append_item(const OUString& rId, const OUString& rStr)
|
||||
{
|
||||
insert_item(-1, rId, rStr, nullptr, nullptr, TRISTATE_INDET);
|
||||
}
|
||||
void append_item_check(const OUString& rId, const OUString& rStr)
|
||||
{
|
||||
insert_item(-1, rId, rStr, nullptr, nullptr, TRISTATE_TRUE);
|
||||
}
|
||||
void append_item_radio(const OUString& rId, const OUString& rStr)
|
||||
{
|
||||
insert_item(-1, rId, rStr, nullptr, nullptr, TRISTATE_FALSE);
|
||||
}
|
||||
void append_item(const OUString& rId, const OUString& rStr, const OUString& rImage)
|
||||
{
|
||||
insert_item(-1, rId, rStr, &rImage, nullptr, TRISTATE_INDET);
|
||||
}
|
||||
void append_item(const OUString& rId, const OUString& rStr, VirtualDevice& rImage)
|
||||
{
|
||||
insert_item(-1, rId, rStr, nullptr, &rImage, TRISTATE_INDET);
|
||||
}
|
||||
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 OUString& rId) = 0;
|
||||
virtual void clear() = 0;
|
||||
virtual void set_item_sensitive(const OUString& rIdent, bool bSensitive) = 0;
|
||||
virtual void set_item_active(const OUString& rIdent, bool bActive) = 0;
|
||||
virtual void set_item_label(const OUString& rIdent, const OUString& rLabel) = 0;
|
||||
virtual OUString get_item_label(const OUString& rIdent) const = 0;
|
||||
virtual void set_item_visible(const OUString& rIdent, bool bVisible) = 0;
|
||||
|
||||
virtual void set_popover(weld::Widget* pPopover) = 0;
|
||||
};
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
|
||||
@@ -699,55 +699,6 @@ class VCL_DLLPUBLIC ToggleButton : virtual public Button, virtual public Togglea
|
||||
friend class ::LOKTrigger;
|
||||
};
|
||||
|
||||
class VCL_DLLPUBLIC MenuButton : virtual public ToggleButton
|
||||
{
|
||||
friend class ::LOKTrigger;
|
||||
|
||||
Link<const OUString&, void> m_aSelectHdl;
|
||||
|
||||
protected:
|
||||
void signal_selected(const OUString& rIdent) { m_aSelectHdl.Call(rIdent); }
|
||||
|
||||
public:
|
||||
void connect_selected(const Link<const OUString&, void>& rLink) { m_aSelectHdl = rLink; }
|
||||
|
||||
virtual void insert_item(int pos, const OUString& rId, const OUString& rStr,
|
||||
const OUString* pIconName, VirtualDevice* pImageSurface,
|
||||
TriState eCheckRadioFalse)
|
||||
= 0;
|
||||
void append_item(const OUString& rId, const OUString& rStr)
|
||||
{
|
||||
insert_item(-1, rId, rStr, nullptr, nullptr, TRISTATE_INDET);
|
||||
}
|
||||
void append_item_check(const OUString& rId, const OUString& rStr)
|
||||
{
|
||||
insert_item(-1, rId, rStr, nullptr, nullptr, TRISTATE_TRUE);
|
||||
}
|
||||
void append_item_radio(const OUString& rId, const OUString& rStr)
|
||||
{
|
||||
insert_item(-1, rId, rStr, nullptr, nullptr, TRISTATE_FALSE);
|
||||
}
|
||||
void append_item(const OUString& rId, const OUString& rStr, const OUString& rImage)
|
||||
{
|
||||
insert_item(-1, rId, rStr, &rImage, nullptr, TRISTATE_INDET);
|
||||
}
|
||||
void append_item(const OUString& rId, const OUString& rStr, VirtualDevice& rImage)
|
||||
{
|
||||
insert_item(-1, rId, rStr, nullptr, &rImage, TRISTATE_INDET);
|
||||
}
|
||||
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 OUString& rId) = 0;
|
||||
virtual void clear() = 0;
|
||||
virtual void set_item_sensitive(const OUString& rIdent, bool bSensitive) = 0;
|
||||
virtual void set_item_active(const OUString& rIdent, bool bActive) = 0;
|
||||
virtual void set_item_label(const OUString& rIdent, const OUString& rLabel) = 0;
|
||||
virtual OUString get_item_label(const OUString& rIdent) const = 0;
|
||||
virtual void set_item_visible(const OUString& rIdent, bool bVisible) = 0;
|
||||
|
||||
virtual void set_popover(weld::Widget* pPopover) = 0;
|
||||
};
|
||||
|
||||
class VCL_DLLPUBLIC CheckButton : virtual public Toggleable
|
||||
{
|
||||
protected:
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include <sfx2/tabdlg.hxx>
|
||||
#include <vcl/weld/ComboBox.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/customweld.hxx>
|
||||
#include <vcl/weld/weld.hxx>
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <vcl/svapp.hxx>
|
||||
#include <vcl/stdtext.hxx>
|
||||
#include <vcl/weld/ComboBox.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/weld.hxx>
|
||||
#include <vcl/settings.hxx>
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <vcl/weld/Builder.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/ScrolledWindow.hxx>
|
||||
#include <vcl/weld/weld.hxx>
|
||||
#include <tools/long.hxx>
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <vcl/weld/ComboBox.hxx>
|
||||
#include <vcl/weld/DialogController.hxx>
|
||||
#include <vcl/weld/Entry.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/MetricSpinButton.hxx>
|
||||
#include <vcl/weld/SpinButton.hxx>
|
||||
#include <vcl/weld/TreeView.hxx>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <vcl/InterimItemWindow.hxx>
|
||||
#include <vcl/weld/ComboBox.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
|
||||
#include <recentdocsview.hxx>
|
||||
#include <templatedefaultview.hxx>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <vcl/weld/ComboBox.hxx>
|
||||
#include <vcl/weld/DialogController.hxx>
|
||||
#include <vcl/weld/EntryTreeView.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/MetricSpinButton.hxx>
|
||||
#include <vcl/weld/ScrolledWindow.hxx>
|
||||
#include <vcl/weld/customweld.hxx>
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <vcl/weld/ComboBox.hxx>
|
||||
#include <vcl/weld/DialogController.hxx>
|
||||
#include <vcl/weld/Entry.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/Notebook.hxx>
|
||||
#include <vcl/weld/TextView.hxx>
|
||||
#include <vcl/weld/Toolbar.hxx>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <tools/date.hxx>
|
||||
#include <tools/time.hxx>
|
||||
#include <vcl/InterimItemWindow.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/ScrolledWindow.hxx>
|
||||
#include <vcl/weld/customweld.hxx>
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <string_view>
|
||||
|
||||
#include <vcl/weld/ComboBox.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/weld.hxx>
|
||||
#include <envlop.hxx>
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include <vcl/settings.hxx>
|
||||
#include <vcl/virdev.hxx>
|
||||
#include <vcl/weld/Builder.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <memory>
|
||||
|
||||
#define TEXT_PADDING 5
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include <vcl/svapp.hxx>
|
||||
#include <vcl/settings.hxx>
|
||||
#include <vcl/weld/Builder.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <memory>
|
||||
|
||||
#define BUTTON_WIDTH 30
|
||||
|
||||
@@ -15,6 +15,11 @@
|
||||
#include <vcl/timer.hxx>
|
||||
#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
|
||||
|
||||
namespace weld
|
||||
{
|
||||
class MenuButton;
|
||||
}
|
||||
|
||||
/**
|
||||
* Button painter helper class used to paint a runtime button positioned to a writer frame.
|
||||
* See header/footer button.
|
||||
|
||||
@@ -15,6 +15,11 @@
|
||||
#include <vcl/timer.hxx>
|
||||
#include <optional>
|
||||
|
||||
namespace weld
|
||||
{
|
||||
class MenuButton;
|
||||
}
|
||||
|
||||
class SwPageBreakWin;
|
||||
|
||||
/** Class for the page break control window.
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <vcl/weld/Entry.hxx>
|
||||
#include <vcl/weld/TreeView.hxx>
|
||||
#include <vcl/weld/customweld.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/weld.hxx>
|
||||
|
||||
#include <com/sun/star/text/XAutoTextContainer2.hpp>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <memory>
|
||||
#include <sfx2/tabdlg.hxx>
|
||||
#include <vcl/weld/Entry.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/SpinButton.hxx>
|
||||
#include <swtypes.hxx>
|
||||
#include "numprevw.hxx"
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <vcl/weld/Builder.hxx>
|
||||
#include <vcl/weld/ComboBox.hxx>
|
||||
#include <vcl/weld/Entry.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/MetricSpinButton.hxx>
|
||||
#include <vcl/weld/ScrolledWindow.hxx>
|
||||
#include <vcl/weld/SpinButton.hxx>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <vcl/weld/EntryTreeView.hxx>
|
||||
#include <vcl/weld/FormattedSpinButton.hxx>
|
||||
#include <vcl/weld/Menu.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/MetricSpinButton.hxx>
|
||||
#include <vcl/weld/Notebook.hxx>
|
||||
#include <vcl/weld/Paned.hxx>
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
#include "QtInstanceToggleButton.hxx"
|
||||
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
|
||||
#include <QtWidgets/QToolButton>
|
||||
|
||||
class QtInstanceMenuButton : public QtInstanceToggleButton, public virtual weld::MenuButton
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <vcl/weld/EntryTreeView.hxx>
|
||||
#include <vcl/weld/FormattedSpinButton.hxx>
|
||||
#include <vcl/weld/Menu.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/MetricSpinButton.hxx>
|
||||
#include <vcl/weld/Notebook.hxx>
|
||||
#include <vcl/weld/Scrollbar.hxx>
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <vcl/weld/Builder.hxx>
|
||||
#include <vcl/weld/FormattedSpinButton.hxx>
|
||||
#include <vcl/weld/Menu.hxx>
|
||||
#include <vcl/weld/MenuButton.hxx>
|
||||
#include <vcl/weld/MetricSpinButton.hxx>
|
||||
#include <vcl/weld/Notebook.hxx>
|
||||
#include <vcl/weld/Paned.hxx>
|
||||
|
||||
Reference in New Issue
Block a user