summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar/Layouter.cxx
diff options
context:
space:
mode:
authorAndre Fischer <af@apache.org>2013-07-05 08:53:11 +0000
committerAndre Fischer <af@apache.org>2013-07-05 08:53:11 +0000
commit4f9ac2af7157786ee6fba46551bd6782730d8b55 (patch)
treea4d1f331049a1b88d86c43c354f4ed90473251fd /sfx2/source/sidebar/Layouter.cxx
parent47fc3a3278a7aac0ba2d8f47eb10a83c0a5f40c7 (diff)
122635: Add layouting to some sidebar panels.
Notes
Notes: merged as: c61c5a240314f1899a2160a97e00e2108104e4bd
Diffstat (limited to 'sfx2/source/sidebar/Layouter.cxx')
-rw-r--r--sfx2/source/sidebar/Layouter.cxx118
1 files changed, 118 insertions, 0 deletions
diff --git a/sfx2/source/sidebar/Layouter.cxx b/sfx2/source/sidebar/Layouter.cxx
new file mode 100644
index 000000000000..5b651e376a7b
--- /dev/null
+++ b/sfx2/source/sidebar/Layouter.cxx
@@ -0,0 +1,118 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "precompiled_sfx2.hxx"
+#include "sfx2/sidebar/Layouter.hxx"
+
+#include <vcl/window.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/outdev.hxx>
+
+namespace sfx2 { namespace sidebar {
+
+void Layouter::EnlargeControlHorizontally (
+ Window& rControl,
+ const sal_Int32 nDeltaX)
+{
+ Size aSize (rControl.GetSizePixel());
+ aSize.Width() += nDeltaX;
+ rControl.SetSizePixel(aSize);
+
+}
+
+
+
+
+void Layouter::SetWidth (
+ Window& rControl,
+ const sal_Int32 nWidth)
+{
+ rControl.SetPosSizePixel(
+ 0,0,
+ nWidth,0,
+ WINDOW_POSSIZE_WIDTH);
+}
+
+
+
+
+void Layouter::SetRight (
+ Window& rControl,
+ const sal_Int32 nRight)
+{
+ rControl.SetPosSizePixel(
+ 0,0,
+ nRight-rControl.GetPosPixel().X(),0,
+ WINDOW_POSSIZE_WIDTH);
+}
+
+
+
+
+void Layouter::MoveControlHorizontally (
+ Window& rControl,
+ const sal_Int32 nDeltaX)
+{
+ Point aPosition (rControl.GetPosPixel());
+ aPosition.Move(nDeltaX, 0);
+ rControl.SetPosPixel(aPosition);
+}
+
+
+
+
+void Layouter::SetHorizontalPosition (
+ Window& rControl,
+ const sal_Int32 nX)
+{
+ rControl.SetPosPixel(Point(nX, rControl.GetPosPixel().Y()));
+}
+
+
+
+
+void Layouter::PrepareForLayouting (
+ Window& rControl)
+{
+ // rControl.SetStyle(rControl.GetStyle() | WB_PATHELLIPSIS | WB_INFO);
+}
+
+
+
+
+sal_Int32 Layouter::MapX (
+ const Window& rControl,
+ const sal_Int32 nValue)
+{
+ return rControl.LogicToPixel(Point(nValue,0), MAP_APPFONT).X();
+}
+
+
+
+
+sal_Int32 Layouter::MapWidth (
+ const Window& rControl,
+ const sal_Int32 nValue)
+{
+ return rControl.LogicToPixel(Point(nValue,0), MAP_APPFONT).X();
+}
+
+} } // end of namespace sfx2::sidebar