diff options
-rw-r--r-- | extras/source/glade/libreoffice-catalog.xml.in | 3 | ||||
-rw-r--r-- | include/svx/SvxPresetListBox.hxx | 17 | ||||
-rw-r--r-- | svx/source/tbxctrls/SvxPresetListBox.cxx | 66 |
3 files changed, 0 insertions, 86 deletions
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index 9ee1cc971c6f..b2174e4a59d0 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -206,9 +206,6 @@ <glade-widget-class title="SvxColorValueSet" name="svxcorelo-SvxColorValueSet" generic-name="Set of Value Options" parent="GtkDrawingArea" icon-name="widget-gtk-drawingarea"/> - <glade-widget-class title="SvxPresetListBox" name="svxcorelo-SvxPresetListBox" - generic-name="Set of Value Options" parent="GtkDrawingArea" - icon-name="widget-gtk-drawingarea"/> <glade-widget-class title="TableValueSet" name="sdlo-TableValueSet" generic-name="Set of Table Value Options" parent="GtkDrawingArea" icon-name="widget-gtk-drawingarea"/> diff --git a/include/svx/SvxPresetListBox.hxx b/include/svx/SvxPresetListBox.hxx index b090a65d60cf..888f93b86109 100644 --- a/include/svx/SvxPresetListBox.hxx +++ b/include/svx/SvxPresetListBox.hxx @@ -27,23 +27,6 @@ #include <svx/xtable.hxx> #include <tools/gen.hxx> -class SVX_DLLPUBLIC SvxPresetListBox : public ValueSet -{ -private: - sal_uInt32 nColCount; - - DECL_LINK( OnMenuItemSelected, Menu*, bool ); - -public: - SvxPresetListBox(vcl::Window* pParent, WinBits nWinStyle); - - virtual void Resize() override; - virtual void Command( const CommandEvent& rEvt ) override; - sal_uInt32 getColumnCount() const { return nColCount; } - - void DrawLayout(); -}; - class SVX_DLLPUBLIC PresetListBox : public SvtValueSet { private: diff --git a/svx/source/tbxctrls/SvxPresetListBox.cxx b/svx/source/tbxctrls/SvxPresetListBox.cxx index 6d136e8170d7..71f8e6514458 100644 --- a/svx/source/tbxctrls/SvxPresetListBox.cxx +++ b/svx/source/tbxctrls/SvxPresetListBox.cxx @@ -26,72 +26,6 @@ #include <vcl/menu.hxx> #include <vcl/popupmenuwindow.hxx> -SvxPresetListBox::SvxPresetListBox(vcl::Window* pParent, WinBits nWinStyle) - : ValueSet(pParent, nWinStyle), - nColCount(3) -{ - SetEdgeBlending(true); - SetExtraSpacing(4); -} - - -VCL_BUILDER_FACTORY_CONSTRUCTOR(SvxPresetListBox, WB_ITEMBORDER| WB_3DLOOK|WB_OWNERDRAWDECORATION|WB_TABSTOP) - -void SvxPresetListBox::Resize() -{ - DrawLayout(); - WinBits aWinBits(GetStyle()); - aWinBits |= WB_VSCROLL; - SetStyle(aWinBits); - ValueSet::Resize(); -} - -void SvxPresetListBox::Command( const CommandEvent& rEvent ) -{ - switch(rEvent.GetCommand()) - { - case CommandEventId::ContextMenu: - { - const sal_uInt16 nIndex = GetSelectedItemId(); - if(nIndex > 0) - { - Point aPos(rEvent.GetMousePosPixel()); - VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "svx/ui/presetmenu.ui", ""); - VclPtr<PopupMenu> pMenu(aBuilder.get_menu("menu")); - FloatingWindow* pMenuWindow = dynamic_cast<FloatingWindow*>(pMenu->GetWindow()); - if(pMenuWindow != nullptr) - { - pMenuWindow->SetPopupModeFlags( - pMenuWindow->GetPopupModeFlags() | FloatWinPopupFlags::NoMouseUpClose); - } - pMenu->SetSelectHdl( LINK(this, SvxPresetListBox, OnMenuItemSelected) ); - pMenu->Execute(this,tools::Rectangle(aPos,Size(1,1)),PopupMenuFlags::ExecuteDown); - } - } - break; - default: - ValueSet::Command( rEvent ); - break; - } -} - -void SvxPresetListBox::DrawLayout() -{ - SetColCount(getColumnCount()); - SetLineCount(5); -} - -IMPL_LINK(SvxPresetListBox, OnMenuItemSelected, Menu*, pMenu, bool) -{ - if( pMenu == nullptr ) - { - OSL_ENSURE( pMenu != nullptr, "SvxPresetListBox::OnMenuItemSelected : illegal menu!" ); - return false; - } - pMenu->Deactivate(); - return false; -} - PresetListBox::PresetListBox(std::unique_ptr<weld::ScrolledWindow> pWindow) : SvtValueSet(std::move(pWindow)) , nColCount(3) |