Kaydet (Commit) ca6aa93f authored tarafından Caolán McNamara's avatar Caolán McNamara

add infrastructure for secondary button groups

Change-Id: I5fd1bbc31a0259e92f6eb23beef5d3c77b74eed8
üst 324e116a
......@@ -1119,67 +1119,41 @@ public:
Size get_preferred_size() const;
/*
* Gets the value of the "halign" property.
* How to horizontally align this widget
*/
VclAlign get_halign() const;
/*
* Sets the horizontal alignment of widget. See the "halign" property.
*/
void set_halign(VclAlign eAlign);
/*
* Gets the value of the "valign" property.
* How to vertically align this widget
*/
VclAlign get_valign() const;
/*
* Sets the horizontal alignment of widget. See the "valign" property.
*/
void set_valign(VclAlign eAlign);
/*
* Gets whether the widget would like to use any available extra horizontal
* Whether the widget would like to use any available extra horizontal
* space.
*/
bool get_hexpand() const;
/*
* Sets whether the widget would like to use any available extra horizontal
* space.
*/
void set_hexpand(bool bExpand);
/*
* Gets whether the widget would like to use any available extra vertical
* Whether the widget would like to use any available extra vertical
* space.
*/
bool get_vexpand() const;
/*
* Sets whether the widget would like to use any available extra vertical
* space.
*/
void set_vexpand(bool bExpand);
/*
* Gets whether the widget would like to use any available extra space.
* Whether the widget would like to use any available extra space.
*/
bool get_expand() const;
/*
* Sets whether the widget would like to use any available extra space.
*/
void set_expand(bool bExpand);
/*
* Gets whether the widget should receive extra space when the parent grows
* Whether the widget should receive extra space when the parent grows
*/
bool get_fill() const;
/*
* Sets whether the widget should receive extra space when the parent grows
*/
void set_fill(bool bFill);
void set_border_width(sal_Int32 nBorderWidth);
......@@ -1198,64 +1172,47 @@ public:
sal_Int32 get_margin_bottom() const;
/*
* Gets how the widget is packed with reference to the start or end of the parent
* How the widget is packed with reference to the start or end of the parent
*/
VclPackType get_pack_type() const;
/*
* Sets how the widget is packed with reference to the start or end of the parent
*/
void set_pack_type(VclPackType ePackType);
/*
* Sets extra space to put between the widget and its neighbors
* The extra space to put between the widget and its neighbors
*/
sal_Int32 get_padding() const;
/*
* Sets extra space to put between the widget and its neighbors
*/
void set_padding(sal_Int32 nPadding);
/*
* Gets the number of columns that the widget spans
* The number of columns that the widget spans
*/
sal_Int32 get_grid_width() const;
/*
* Sets the number of columns that the widget spans
*/
void set_grid_width(sal_Int32 nCols);
/*
* Gets the column number to attach the left side of the widget to
* The column number to attach the left side of the widget to
*/
sal_Int32 get_grid_left_attach() const;
/*
* Sets the column number to attach the left side of the widget to
*/
void set_grid_left_attach(sal_Int32 nAttach);
/*
* Gets the number of row that the widget spans
* The number of row that the widget spans
*/
sal_Int32 get_grid_height() const;
/*
* Sets the number of row that the widget spans
*/
void set_grid_height(sal_Int32 nRows);
/*
* Gets the row number to attach the top side of the widget to
* The row number to attach the top side of the widget to
*/
sal_Int32 get_grid_top_attach() const;
void set_grid_top_attach(sal_Int32 nAttach);
/*
* Sets the row number to attach the top side of the widget to
* If true this child appears in a secondary layout group of children
* e.g. help buttons in a buttonbox
*/
void set_grid_top_attach(sal_Int32 nAttach);
bool get_secondary() const;
void set_secondary(bool bSecondary);
/*
* Sets a widget property
......
......@@ -403,7 +403,8 @@ public:
mbHexpand:1,
mbVexpand:1,
mbExpand:1,
mbFill:1;
mbFill:1,
mbSecondary:1;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer;
};
......
......@@ -1460,6 +1460,10 @@ void VclBuilder::applyPackingProperty(Window *pCurrent,
{
set_window_packing_position(pCurrent, sValue.toInt32());
}
else if (sKey == "secondary")
{
pCurrent->set_secondary(toBool(sValue));
}
else
{
SAL_WARN("vcl.layout", "unknown packing: " << sKey.getStr());
......
......@@ -255,6 +255,7 @@ Size VclButtonBox::calculateRequisition() const
{
if (!pChild->IsVisible())
continue;
SAL_WARN_IF(pChild->get_secondary(), "vcl.layout", "secondary groups not implemented yet");
++nVisibleChildren;
Size aChildSize = getLayoutRequisition(*pChild);
if (aChildSize.Width() > aSize.Width())
......
......@@ -726,6 +726,7 @@ void Window::ImplInitWindowData( WindowType nType )
mpWindowImpl->mbVexpand = false;
mpWindowImpl->mbExpand = false;
mpWindowImpl->mbFill = true;
mpWindowImpl->mbSecondary = false;
mbEnableRTL = Application::GetSettings().GetLayoutRTL(); // sal_True: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active
......
......@@ -1925,6 +1925,7 @@ void Window::take_properties(Window &rOther)
mpWindowImpl->mbVexpand = pWindowImpl->mbVexpand;
mpWindowImpl->mbExpand = pWindowImpl->mbExpand;
mpWindowImpl->mbFill = pWindowImpl->mbFill;
mpWindowImpl->mbSecondary = pWindowImpl->mbSecondary;
bool bHasBorderWindow = mpWindowImpl->mpBorderWindow;
bool bOtherHasBorderWindow = pWindowImpl->mpBorderWindow;
......@@ -2321,4 +2322,16 @@ sal_Int32 Window::get_width_request() const
return pWindowImpl->mnWidthRequest;
}
bool Window::get_secondary() const
{
WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
return pWindowImpl->mbSecondary;
}
void Window::set_secondary(bool bSecondary)
{
WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl : mpWindowImpl;
pWindowImpl->mbSecondary = bSecondary;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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