LibreOffice Module svx (master)  1
labelitemwindow.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #include <svx/labelitemwindow.hxx>
11 
12 LabelItemWindow::LabelItemWindow(vcl::Window* pParent, const OUString& rLabel)
13  : InterimItemWindow(pParent, "svx/ui/labelbox.ui", "LabelBox")
14  , m_xLabel(m_xBuilder->weld_label("label"))
15 {
17 
18  m_xLabel->set_label(rLabel);
19 
21 
22  m_xLabel->set_toolbar_background();
23 }
24 
26 {
27  Size aSize(m_xLabel->get_preferred_size());
28  aSize.AdjustWidth(12);
29 
30  SetSizePixel(aSize);
31 }
32 
33 void LabelItemWindow::set_label(const OUString& rLabel) { m_xLabel->set_label(rLabel); }
34 
35 OUString LabelItemWindow::get_label() const { return m_xLabel->get_label(); }
36 
38 {
39  m_xLabel.reset();
41 }
42 
44 
45 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
long AdjustWidth(long n)
virtual void dispose() override
virtual void SetSizePixel(const Size &rNewSize)
std::unique_ptr< weld::Label > m_xLabel
virtual ~LabelItemWindow() override
LabelItemWindow(vcl::Window *pParent, const OUString &rLabel)
std::unique_ptr< weld::Label > m_xLabel
virtual void dispose() override
OUString get_label() const
void InitControlBase(weld::Widget *pWidget)
void set_label(const OUString &rLabel)